Linking static libraries
I have a project that uses several static libraries and I keep getting errors like this one:
ld: duplicate symbol _deg2Rad in Frameworks/MyFramework.embeddedframework/
MyFramework.framework/MyFramework(MyFramework) and Frameworks/
MyFramework.embeddedframework/MyFramework.framework/MyFramework(MyFramework) for
architecture armv7
Command /开发者_运维知识库***/Development/Platforms/iPhoneOS.platform/Developer/
usr/bin/clang failed with exit code 1
I assume that it has something to do with ARC which I use as well in my project as in the library stated in the error. The stated library furthermore uses one static library that has NOT enabled ARC. My deployment target is 4.3. The libraries are deployed on iOS 5.0.
I had the libs deployed on 4.3 before but I got similar errors with _objc_retainedObj instead of _deg2Rad.
Any help is very much appreciated! What else information might help someone solving this?
Thanks
Most likely your static libraries use the same function (i.e. deg2Rad) and you are getting this...
Unfortunately although those providing Static Libraries should custom Prefix all their functions, however they do not do, so you end up in those situations...
Solution is to contact them and ask them to custom prefix their functions and variables that are exposed by their .h files...
In your compiler flags configuration, do you have -ObjC -all_load
? Try adding those to your project's target. Then clean and rebuild. I've had that problem as well sometimes and it was usually because I forgot those flags.
Forgetting to adjust the framework search path is another reason for having problems with building frameworks.
精彩评论