0

I have a project that builds just fine in Release Mode but Debug Mode shows many Redefinition errors at compile time. As shown in the snapshot attached.Error Snapshot

Is there any way that can force XCode to just ignore these errors?

Update:

I know it's not the right way to go but I just want to know if it can be done or not.

UPDATE-2:

The redefinition was due to a redundant .pch file. I have solved this issue.

d0mbn00b
  • 5
  • 6
  • 1
    Why not try and *fix* the errors instead of just silencing them? – Some programmer dude Mar 06 '17 at 09:26
  • 1
    Fix the redefinitions in 1st place1 – πάντα ῥεῖ Mar 06 '17 at 09:27
  • @Someprogrammerdude Because they are not redefined anywhere else. I don't know whats going on here but silencing them would make the build successful. – d0mbn00b Mar 06 '17 at 09:39
  • @d0mbn00b ‘*Because they are not redefined anywhere else.*’ You think the compiler just made that up? – Biffen Mar 06 '17 at 09:42
  • 1
    Without being able to see the full error messages (why don't you get a text-view of the build output, and copy-paste it into the question body as you should (please [read about how to ask good questions](http://stackoverflow.com/help/how-to-ask))) it's hard to tell, but usually you will get a message saying *where* the first definition was. That way you should be able to find out how the two definitions differ and a possible way to fix it. – Some programmer dude Mar 06 '17 at 09:44
  • @Biffen No no. There's definitely something going on. Compiler didn't made that up. But as far as this project goes these variables are not defined anywhere else. Because I couldn't find them anywhere, except this one file where the errors are. – d0mbn00b Mar 06 '17 at 09:46
  • 1
    @d0mbn00b My guess is that that file gets included more than once, with some preprocessor variables having different values. – Biffen Mar 06 '17 at 09:47
  • @Biffen There's `#pragma once` in the header file. – d0mbn00b Mar 06 '17 at 09:50
  • @d0mbn00b Yes. That doesn't mean it can't be included by multiple compilation units. – Biffen Mar 06 '17 at 09:52
  • 1
    @d0mbn00b `#pragma once` or other header include guard only protects against multiple inclusion in the same [*translation unit*](https://en.wikipedia.org/wiki/Translation_unit_(programming)). If two or more source files include a header file where variables are defined you will get multiple definition errors. – Some programmer dude Mar 06 '17 at 09:53
  • @Someprogrammerdude Okay! I didn't know that. Thank you. – d0mbn00b Mar 06 '17 at 09:54
  • @Someprogrammerdude The redefinition was due to a redundant `.pch` file. I have solved this issue. – d0mbn00b Mar 06 '17 at 10:26

0 Answers0