Closed u10int closed 12 years ago
More info... the issue seems to happen mostly in Xcode 4.2, though have verified it occurs in Xcode 4.0 also.
Hmm... I'm not sure what would cause this. Can you distill it into a project that you can send to me? I'm still in Xcode 4.0.2 since I haven't been able to get Lion installed yet.
Xcode 4.2 beta also runs on Snow Leopard FYI.
@kstenerud Sample project sent. Note that since I'm using Xcode 4.2 beta the project depends on libz.1.2.5.dylib, which is not yet available in Xcode 4.x. You can just remove this dependency and replace it with libz.1.2.3.dylib when testing.
You can link on libz.dylib which is a symlink that points to the latest version of libz so that it will work with any version of the SDK.
@0xced sweet thanks, good to know.
With the help of @kstenerud, found the issue. Posting it here in case others have the same and for reference.
It appears that somehow a reference to Build/Products was automatically included in the Framework Search Paths build setting. Once I removed that, the duplicate symbol errors were gone. :)
try this:
add "-all_load" in "other link flag"
Thanks for the awesome work as it works really well for creating custom static frameworks!
I have noticed an issue that seems to be random, though. I have custom categories in my framework, so I had to use your LoadableCategory.h method so that they are properly linked into the final library. For the most part this works well without any issues. At times, especially when creating an archived build for adhoc distribution of my app using the custom framework, I get a compiler error similar to:
ld: duplicate symbol _OBJCCLASS$_FORCELOAD_SomeConcreteClass_MyAdditions in...
In the class category implementations I am using your MAKE_CATEGORIES_LOADABLE(SomeConcreteClass_MyAdditions); method, making sure it's always unique. I don't always get the duplicate symbol error on the same category, which makes it appear to be more random and something odd is happening. I have verified the files don't exist more than once which I know also causes the duplicate symbol error.
Any ideas?