我正在尝试在iOS中模拟触摸。在SO中有一些指针建议我可以在私有框架中尝试GraphicsServices/gseven .h。然而,当我按照这里的步骤执行时,我得到了这些错误:
Undefined symbols for architecture armv7:
"_GSCopyPurpleNamedPort", referenced from:
-[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
"_GSSendEvent", referenced from:
-[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
任何建议吗?由于
编辑:我使用的代码来自Using GraphicsServices.h/GSEvent以及用Xcode编译CLI iPhone工具。
看起来错误来自这一行。
mach_port_t thePortOfApp = GSCopyPurpleNamedPort...
GSSendEvent(&record, thePortOfApp);
好吧,我想我在添加框架时犯了一些错误。不知怎么的,我的项目现在开始工作了。
在我做了一些事情之后,错误已经消失了。在构建设置中,我将总是搜索用户路径更改为Yes。在用户头搜索路径中增加私有头的路径。此外,在Build Phrases选项卡中,我在Link Binary with Libraries部分中添加GraphicsServices。
现在我可以做简单的东西,如gsevenlockdevice()和模拟按home键。