我正在尝试绑定(bind)到 BugSense 的库,但很难尝试在额外的构建参数中使用 -gcc_flags
包含框架。 BugSense 提供了一个 .framework,而不是静态的 .a lib。再多的谷歌搜索也无法让我找到如何将框架正确链接到我的项目的解决方案。
到目前为止我有这样的事情:
-v -v -v -gcc_flags "-framework ${ProjectDir}/../References/BugSense-iOS.framework"
我已将 .framework 文件夹复制到我的 References 文件夹中。
构建项目会导致此 mtouch 错误:
Error 1: mtouch failed with the following message:
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m: In function 'main':
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:1838: warning: implicit declaration of function 'monotouch_enable_debug_tracking'
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:1921: warning: implicit declaration of function 'mini_get_debug_options'
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:1925: warning: implicit declaration of function 'mono_debugger_agent_parse_options'
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:2059: warning: cast from pointer to integer of different size
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:2059: warning: initialization makes pointer from integer without a cast
ld: framework not found /Users/xxx/Projects/myProj/myProj/../References/BugSense-iOS.framework
collect2: ld returned 1 exit status
最佳答案
我相信它就像库:您指定框架的名称,然后指定搜索位置。
-F <dir>
-framework <name>
所以试试这个:
-gcc_flags "-F ${ProjectDir}/../References -framework BugSense-IOS"
关于xamarin.ios - 绑定(bind)到自定义.framework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6514128/