Issue
I'm trying to link complicated native project for Xamarin. It's Obj-C UI Project that depends on Native Obc-C++ wrapper over c++ library (this is embedded project):
I have native source and test project in Xcode and everything goes fine.
Then I make fat libraries of all dependencies, add them to xamarin binding project.
In main project i had to setup gcc options same for simulator and device:
-vvvv -cxx --registrar:static -gcc_flags "-L${ProjectDir}/../RMSDKWrapper -dead_strip -lstdc++ -lstdc++.6.0.9 -lpthread -lsqlite3 -lxml2 -ObjC -ladept-iOS -lxml-iOS -lz -lcurl -lssl -lcrypto -ldp-iOS -lePub3-iOS -L/usr/lib -I/usr/include/libxml2"
Everything works fine on Simulator but when i'm trying to compile this for Device, linker can't link libs because of duplicate symbols. I checked all libs using 'nm' all objects are looking the same for Simulator and Device.
I saw that only objects that duplicated is Obj-C++ classes in embedded wrapper (rmsdk_wrapper2.xcodeproj). nm
finds that objects in wrapper lib and in lib from host project(TestRMSD.xcodeproj). But for simulator it resolves well, neither for device.
UPD XS Version: https://gist.github.com/ad1Dima/eb1cc390930e191a5454260da2410c91
Build Log: https://gist.github.com/ad1Dima/8ea8c4a271ef63efb310252234b32ae5
I need any idea how can i solve this problem.
Solution
I had to move all native code in one XCode project to solve this issue. So i have one lib and no linking errors on device.
But i didn't understand what was wrong with linker.
Answered By - ad1Dima