尝试使用 clang 编译我的 C++ 应用程序,该应用程序有效,但出现以下链接器错误:
Undefined symbols for architecture x86_64:
"_DADiskCopyDescription", referenced from:
Security::getHddID() in Security.cpp.o
"_DADiskCreateFromBSDName", referenced from:
Security::getHddID() in Security.cpp.o
"_DASessionCreate", referenced from:
Security::getHddID() in Security.cpp.o
ld: symbol(s) not found for architecture x86_64
我已经在 Apple 网站上查看了磁盘仲裁的官方文档,但这很糟糕,因为它甚至没有告诉您要包含哪个库文件,更不用说链接到什么了。
我正在使用 CMake 来设置我的构建链。
最佳答案
您需要在链接器参数中使用-framework DiskArbitration
。
关于c++ - OSX 磁盘仲裁链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29158243/