开发者

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

开发者 https://www.devze.com 2023-04-04 08:37 出处:网络
I\'m attempting to use Text Input Source Services to detect the current keyboard layout: TISInputSourceRef source = TISCopyCurrentKeyboardInputSource(); //Mach-O Linker Error

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

精彩评论

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

关注公众号