I was working on my program, and it seems something in the settings changed. Suddenly I have the error "Duplicate interface declaration for class 'Foo'". It mentions a header file being duplicated but there's only one copy.
Interestingly this is only happening in debug mode, not device mode.
Does anyone have any idea what might be wrong?
I am using Objective-C++ and some static libraries.
I had exactly the same problem. I had two copies of the header and had deleted the old one by deleting the reference to it in Xcode. There was then only one reference of the header which pointed to the new header file in the project navigator.
After actually deleting the old header from the file system, the problem went away.
It could be a bug in Xcode. Maybe sometimes when you delete a reference to a file, part of the reference still remains in the project file.
I have this error message and I don't have the the duplicate header or duplicate imports. The problem is that I've renamed the header file and Xcode somehow keep them cached, that gives the build error.
I did the following to fix this. Hope it helps those that already tried other answer and still got the errors.
I found the problem. There were two copies of the header file and Xcode got confused.
Now the mystery is how Xcode decided to copy these files by itself ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With