I'm attempting to use Text Input Source Services to detect the current keyboard layout:
TISInputSourceRef source = TISCopyCurrentKeyboardInputSource(); //Mach-O Linker Error
NSLog(@"languages: %@", TISGetInputSourceProperty(source, kTISPropertyInputSourceLanguages));
NSLog(@"localized name: %@", TISGe开发者_StackOverflow中文版tInputSourceProperty(source, kTISPropertyLocalizedName));
Which is a ('modern') carbon function I reference with: #import <Carbon/Carbon.h>
Docs: (don't mention anything about x86 vs. x64) http://developer.apple.com/library/mac/#documentation/TextFonts/Reference/TextInputSourcesReference/Reference/reference.html
Undefined symbols for architecture x86_64:
"_TISCopyCurrentKeyboardInputSource", referenced from:
-[XXXFILE YYYEVENT:] in ZZZPROJECT.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there a reason I can't use TIS with the x86_64
compiler?
Thanks to Bavarious's comment on the qusetion, added the Carbon.framework rather than just #include
ing it. Answer with a real Stack Overflow Answer
and I will upvote it!
精彩评论