我已經用Xamarin創建了一個簡單的綁定項目。綁定項目導入一個靜態庫MyLibrary.a
。它還包含通過sharpie工具製作的ApiDefinition.cs
和StructAndEnum.cs
。將stdlibs與Xamarin鏈接
現在我有一個iOS項目鏈接該綁定項目。 MyLibrary.a
爲了工作需要一些框架和libs(見下文)。
爲了使它的工作,我也跟着Xamarin documentation。
在iOS項目中,我添加了以下mtouch arguments
(另請參見附圖)。
--cxx -gcc_flags "-L${ProjectDir} -framework CFNetwork -framework SystemConfiguration -framework MobileCoreServices -framework Security -framework AVFoundation -libicucore -libxml2 -libc++ -libzd -libstdc++.6.0.9"
當我嘗試編譯我總是生成錯誤結束。
MTOUCH: error MT5209: Native linking error: library not found for -libicucore MTOUCH: error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -L/Users/tmp/Documents/Projects/Ovp/BindinTest.iOS -framework CFNetwork -framework SystemConfiguration -framework MobileCoreServices -framework Security -framework AVFoundation -libicucore -libxml2 -libc++ -libzd -libstdc++.6.0.9 MTOUCH: error MT5202: Native linking failed. Please review the build log.
任何線索,使其工作?可能缺少了什麼?
非常感謝您。
邁克,是的,這是我的'-libicucore'不正確。 icucore是一個stdlib,那麼,我需要將它指定爲'-L/path/to/the/lib -licucore'嗎?謝謝。 –
這不是一個標準的海灣合作委員會圖書館,但我相信它的iOS的「標準」,所以 我不能說它是否會被默認發現,但你的海灣合作委員會工具鏈是 適用於iOS。不要嘗試'-L',看看。如果找不到庫 ,那麼您需要找到它所在的位置,並在其中添加一個「-L」。 –
感謝您的回覆。你能給我一個關於GCC和gcc_flags的介紹嗎? –