开发者

Text Input Source Services gives Mach-O Linker error for architecture x86_64?

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 #includeing it. Answer with a real Stack Overflow Answer and I will upvote it!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜