我编写了一个objective类,用于使用FSEventStreamCreate()查看特定文件夹。当我在基于GUI的应用程序中使用这个类时,这个类就像预期的那样工作。
现在,我正在尝试使用这个类编写命令行应用程序。该项目未能链接:(
以下是错误消息
架构x86_64的未定义符号: "_FSEventStreamCreate",引用自: -MyFSWatcher initializeEventStream在MyFSWatcher.o "_FSEventStreamScheduleWithRunLoop",引用自: -MyFSWatcher initializeEventStream在MyFSWatcher.o "_FSEventStreamStart",引用自: -MyFSWatcher initializeEventStream在MyFSWatcher.o ld:在体系结构x86_64中找不到符号 clang:错误:链接器命令失败,退出代码1
我猜我漏掉了一些链接器标志。谁能指出这点吗?
发布于 2013-04-01 22:02:55
FSEvents API是CoreServices的一部分,因此您需要针对它进行链接。
如果要从命令行编译,请使用:
clang -framework CoreServices ...
https://stackoverflow.com/questions/15752583
复制相似问题