Pregunta

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?

¿Fue útil?

Solución

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 ...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top