I’m trying to make a CGEventTap work. I think I’ve done everything correctly but when I go to run I get this error:
Apple Mach-O Linker (id) Error
Undefined symbols for architecture x86_64:
"_tapCallback", referenced from:
-[TestAppDelegate applicationDidFinishLaunching:] in TestAppDelegate.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
It sounds like you have defined your
tapCallback()function, but haven’t actually implemented it. In other words, yourTestAppDelegateclass probably looks something like this:Somewhere along the lines, you’ll need to actually implement the
tapCallback()function. If you have actually implemented it, say, in another file, make sure that file is included in your built target.Otherwise, doing something like this should allow the program to run: