I have a problem sharing a static library to my xcode sub projects. Assuming the structure of my project is like this:
Main.xcodeproj
|
|_Cordova.xcodeproj
|
|_SubProject1.xcodeproj
|
|_SubProject2.xcodeproj
I have create the static library for:
- SubProject1
- SubProject2
These libraries needs to be linked with the Cordova Static Library.
I've done this by:
- Open SubProject1
- Add the Cordova static library in the "Link Binary With Libraries" section
then
- Open SubProject2
- Add the Cordova static library in the "Link Binary With Libraries" section
After that,
- Opened the Main.xcodeproj
- Add Target Depedendency for SubProject1
- Add Target Depedendency for SubProject2
- Add Link Binary With Libraries for SubProject1 static library
- Add Link Binary With Libraries for SubProject2 static library
If i build i obtain the following errors:
duplicate symbol _OBJC_IVAR_$_CDVViewController._commandQueue in:
/Users/xxx/Library/Developer/Xcode/DerivedData/appxxx/Build/Products/Debug-iphonesimulator/libSubProject1.a(CDVViewController.o)
/Users/xxx/Library/Developer/Xcode/DerivedData/appxxx/Build/Products/Debug-iphonesimulator/libSubProject2.a(CDVViewController.o)
duplicate symbol _OBJC_IVAR_$_CDVViewController._commandDelegate in:
/Users/xxx/Library/Developer/Xcode/DerivedData/appxxx/Build/Products/Debug-iphonesimulator/libSubProject1.a(CDVViewController.o)
/Users/xxx/Library/Developer/Xcode/DerivedData/appxxx/Build/Products/Debug-iphonesimulator/libSubProject2.a(CDVViewController.o)
How can I share this library across these two sub projects?
Thank you so much