我寫了一個Objective-c類,用於使用FSEventStreamCreate()來觀察特定的文件夾。當我在基於GUI的應用程序中使用它時,該類將按預期工作。fsevents命令行
現在我正在嘗試使用這個類編寫一個命令行應用程序。該項目未能鏈接:(
以下是錯誤消息
Undefined symbols for architecture x86_64:
"_FSEventStreamCreate", referenced from:
-[MyFSWatcher initializeEventStream] in MyFSWatcher.o
"_FSEventStreamScheduleWithRunLoop", referenced from:
-[MyFSWatcher initializeEventStream] in MyFSWatcher.o
"_FSEventStreamStart", referenced from:
-[MyFSWatcher initializeEventStream] in MyFSWatcher.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1
我猜我錯過了一些連接標誌。有人請指出這一點?
是的,這是正確的。我只是閱讀:https://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/FSEvents_ProgGuide/UsingtheFSEventsFramework/UsingtheFSEventsFramework.html – vrrathod