Linking failure with a MonoTouch native library binding

纵然是瞬间 提交于 2019-12-22 09:54:54

问题


I am creating native library binding for the Wikitude SDK.

The MonoTouch app fails linking:

Undefined symbols for architecture armv7:
"std::__1::basic_string, std::__1::allocator >::find_last_of(char const*, unsigned long, unsigned long) const", referenced from: WtUnzip::unzipFileTo(char const*, bool)in WikitudeSDK.a(wtunzip.o) ...

My LinkWith:

[assembly: LinkWith ("WikitudeSDK.a", LinkTarget.ArmV7, Frameworks = "CoreVideo Security SystemConfiguration CoreMedia AVFoundation CFNetwork CoreLocation CoreMotion MediaPlayer OpenGLES QuartzCore CoreGraphics", ForceLoad = true, LinkerFlags = "-lsqlite3.0 -ObjC", IsCxx = true)]

I have to admit that I am new to this MonoTouch/IOS world, by I am trying to get my head out of the water.

What should I do to get my app to link?


回答1:


I just figured that I needed to add libc++ in my LinkWith. My new LinkWith looks like this:

[assembly: LinkWith ("WikitudeSDK.a", LinkTarget.ArmV7, Frameworks = "CoreVideo Security SystemConfiguration CoreMedia AVFoundation CFNetwork CoreLocation CoreMotion MediaPlayer OpenGLES QuartzCore CoreGraphics", ForceLoad = true, LinkerFlags = "-lsqlite3.0 -ObjC -lc++", IsCxx = true)]

Hopefully that can eventually help others.




回答2:


I was dealing with an issue where the linking step was failing with "Native linking failed, undefined symbol: std::string::find_last_of(char const*, unsigned long, unsigned long)..."

It turned out the iOS Deployment Target for the app was apparently not matched with the original native library. By matching those up (by comparing against a working "consumer" of the same binding library) I was able to get past the errors.



来源:https://stackoverflow.com/questions/16513979/linking-failure-with-a-monotouch-native-library-binding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!