I am able to successfully create dll file for my Objective-C
static library. But when I am try to reference that dll from Xamarin.iOS
application and compiling, it is giving me lot of error like...
Error MT5210: Native linking failed, undefined symbol: _AudioFileClose. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210)
Error MT5210: Native linking failed, undefined symbol: std::ios_base::Init::Init(). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210)
Error MT5202: Native linking failed. Please review the build log. (MT5202)
After this, I tried to link my .a library using Addtional mtouch Arguments. After adding those arguments, I am getting the new error.
Could not parse the command line arguments: Cannot bundle unregistered option '-o'.
Could someone please help me in resolving this issues.
As Stephane mentioned, there's a IsCxx property on the LinkWithAttribute that you can set to specify that the .a library is a c++ library. That'll solve the std::ios_base::Init::Init()
error.
To solve the undefined symbol: _AudioFileClose
error, you might try adding the CoreAudio or perhaps AudioToolbox framework to the list of frameworks to link against:
[assembly: LinkWith (..., IsCxx = true, Frameworks = "CoreAudio AudioToolbox")]
Hopefully even if that doesn't quite work, it'll get you headed in the right direction.
Finally figured out the error!!
[assembly: LinkWith (..., IsCxx = true, Frameworks = "CoreAudio AudioToolbox", LinkerFlags = "-lstdc++ -lz" )]
In iOS Binding Projet
Options > Build > Compiler > Addition Arguments
-cxx -gcc_flags "-stdlib=libstdc++ -L${ProjectDir} -lMylibrary -force_load ${ProjectDir}/libMylibrary.a”
In my demo application
Options > iOS Buidl > Addtional mtouch Arguments
--gcc_flags="-stdlib=libstdc++"
By giving the proper flags in all the places it resolved my issue.
I resolved this problem installing the new version of Xcode. (now 7.1) The error is misleading but now it works!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.