1

I have written an objective-c class for watching a particular folder using FSEventStreamCreate(). This class work as expected when I am using it in GUI based application.

Now I am trying to write a commandline application using this class. The project fails to link :(

following is the error message

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

I am guessing I am missing some linker flags. Can someone please point that out?

vrrathod
  • 1,230
  • 2
  • 18
  • 28

1 Answers1

4

The FSEvents API is part of CoreServices, so you'll need to link against that.

If you're compiling from the commandline, use:

clang -framework CoreServices ...

jatoben
  • 3,079
  • 15
  • 12
  • Yes thats right. I was just reading : https://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/FSEvents_ProgGuide/UsingtheFSEventsFramework/UsingtheFSEventsFramework.html – vrrathod Apr 01 '13 at 22:05