Reputation: 33116
I am trying to add this photo browser library to our project. I am following Method 2: Static Library in the readme.md file. Basically, it is very standard steps for adding static libraries in Xcode. Things work out fine if I create a simple hello world project. However, when I add the library to our existing project, we get the following duplicate symbol error.
Here is an example of the error (there are a lot more but they all looks similar):
duplicate symbol _OBJC_CLASS_$_MBBarProgressView in:
/Users/.../Build/Intermediates/PDFMaps.build/Debug-iphonesimulator/Project Name.build/Objects-normal/x86_64/MBProgressHUD.o
/Users/.../Build/Products/Debug-iphonesimulator/libMWPhotoBrowser.a(MBProgressHUD.o)
duplicate symbol _OBJC_METACLASS_$_MBBarProgressView in:
/Users/.../Build/Intermediates/PDFMaps.build/Debug-iphonesimulator/Project Name.build/Objects-normal/x86_64/MBProgressHUD.o
/Users/.../Build/Products/Debug-iphonesimulator/libMWPhotoBrowser.a(MBProgressHUD.o)
It seems that duplications always occur between the Intermediates folder and the Products folder. Could anyone explain why is this happening and how to resolve this issue?
Upvotes: 0
Views: 536
Reputation: 328
From the logs it looks like the MWPhotoBrowser library has a class with name MBProgressHUD https://github.com/mwaterfall/MWPhotoBrowser/tree/master/MWPhotoBrowser/Libraries/MBProgressHUD
and also another target in your project hierarchy PDFMaps also has the same name class causing the duplicate symbol error.
Fix is to either rename either one of the classes or reuse MBProgressHUD, whatever works out for you.
Upvotes: 2
Reputation: 6679
I usually see this when one of two things happen:
Here's what I typically do:
Upvotes: 0