不好意思
我为浏览器做了一个插件构建一个库,它将包含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)
链接有问题吗?或另一个吗?怎么解呢?
您似乎没有链接所需的库。快速的谷歌搜索表明,你需要链接到IOKit框架,至少其中一些符号。
我建议你看看Firebreath.org上的Using Libraries页面,了解如何链接到Mac框架。它看起来像这样:
find_library(FRAMEWORK_IOKIT IOKit)
target_link_libraries(${PROJECT_NAME} ${FRAMEWORK_IOKIT})
这个需要放到Mac/projectDef中。