Reputation: 417
I'm adding a twitter module on my program for both iPhone and iPad. And I have met two problems.
1st, on iPhone. After I merged my twitter module to my iPhone program, build fails only in Debug mode. It's ok in Release mode.
The error message is simply
Libxml/xmlreader.h: No such file or directory
Yes, it is because gcc can't locate it.
But I have added -lxml2
for Other Linker Flags, and /usr/include/libxml2/**
for Header Search Paths in project build settings on Release and Debug mode both.
2nd, on iPad. After I merged twitter module to iPad program, build fails with the message below.
ld: duplicate symbol _OBJC_METACLASS_$_MGTwitterEngine in
/Users/eddy/Documents/iOS/workspace/.../i386/MGTwitterEngine-3460BD6C4381A3AC.o and
/Users/eddy/Documents/iOS/workspace/.../i386/MGTwitterEngine-CC42501E82512F61.o
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
failed with exit code 1
I can't figure out the reason why this message comes. Is the readymade module only for iPhone? Or how can I fix it?
Upvotes: 1
Views: 782
Reputation: 6475
Add "/usr/include/libxml2" in the header search path field of your project settings.
You have added the 2 files of same name(here MGTwitterEngine) to the same target.
Upvotes: 2