抱歉我的英文
我为浏览器制作插件以进行firebreath 构建ois库,它将包含firebreath上的插件并获得错误
Undefined symbols for architecture i386:
"_IOCreatePlugInInterfaceForService", referenced from:
OIS::MacHIDManager::iterateAndOpenDevices(unsigned int) in libois.a(MacHIDManager.o)
"_IODestroyPlugInInterface", referenced from:
OIS::MacHIDManager::iterateAndOpenDevices(unsigned int) in libois.a(MacHIDManager.o)
"_IOIteratorNext", referenced from:
OIS::MacHIDManager::iterateAndOpenDevices(unsigned int) in libois.a(MacHIDManager.o)
"_IOObjectRelease", referenced from:
OIS::MacHIDManager::iterateAndOpenDevices(unsigned int) in libois.a(MacHIDManager.o)
"_IORegistryEntryCreateCFProperties", referenced from:
OIS::MacHIDManager::iterateAndOpenDevices(unsigned int) in libois.a(MacHIDManager.o)
"_IOServiceGetMatchingServices", referenced from:
OIS::MacHIDManager::lookUpDevices(int, int) in libois.a(MacHIDManager.o)
"_IOServiceMatching", referenced from:
OIS::MacHIDManager::lookUpDevices(int, int) in libois.a(MacHIDManager.o)
"_kIOMasterPortDefault", referenced from:
OIS::MacHIDManager::lookUpDevices(int, int) in libois.a(MacHIDManager.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
链接问题?或其他?我该如何解决?
答案 0 :(得分:2)
您似乎没有链接所需的库。 quick google search表示您需要链接到IOKit框架以获取至少其中一些符号。
我建议您查看Firebreath.org上的Using Libraries页面,了解有关如何链接到Mac框架的信息。它看起来像这样:
find_library(FRAMEWORK_IOKIT IOKit)
target_link_libraries(${PROJECT_NAME} ${FRAMEWORK_IOKIT})
这需要在你的add_mac_plugin调用之后的某个地方进入Mac / projectDef.cmake。