【发布时间】:2016-11-25 23:37:43
【问题描述】:
我看到一些帖子已经引用了我的问题并解决了它,但它在 2 年前很活跃,我尝试使用它但它对我不起作用(可能是 Xcode 或其他东西的不同) 这是相关的帖子:
Making Xcode ignore static library when building for iOS Simulator
Xcode: Conditional Build Settings based on architecture (Device (ARM) vs Simulator (i386))
我有一个项目使用 vuforia,一个 c++ 库,但是这个库与模拟器不兼容。我想为模拟器编译我的项目(即使使用 lib 的部分显然不起作用)以测试我的应用程序的其他功能。
在我的构建设置中,我有这个:
标题搜索路径:../../build/include
库搜索路径:../../build/lib/arm
我在Other Linker Flags
中什么都没有编译错误发生了变化,现在在我的一个使用 lib 的视图控制器中“找不到 Vuforia/Vuforia.h 文件”。
所以我处理了它,并添加了预处理器指令
#if !(TARGET_OS_SIMULATOR)
....
#endif
它适用于大多数情况,但一个错误仍然存在,即使它位于如上所示的块内
#if !(TARGET_OS_SIMULATOR)
#import <QuartzCore/QuartzCore.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <sys/time.h>
#import <Vuforia/Vuforia.h>
#import <Vuforia/State.h>
#import <Vuforia/Tool.h>
#import <Vuforia/Renderer.h>
#import <Vuforia/TrackableResult.h>
#import <Vuforia/VideoBackgroundConfig.h>
...
#endif
最后,我也尝试使用 Other Linker Flags,但没有帮助...
你能帮我找到如何为iOS设备绑定库并在模拟器上运行应用程序吗?
谢谢!
【问题讨论】:
标签: c++ ios xcode ios-simulator