繁体   English   中英

文本输入源服务为x86_64体系结构提供了Mach-O链接器错误?

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

我正在尝试使用文本输入源服务来检测当前的键盘布局:

TISInputSourceRef source = TISCopyCurrentKeyboardInputSource(); //Mach-O Linker Error
NSLog(@"languages: %@", TISGetInputSourceProperty(source, kTISPropertyInputSourceLanguages));
NSLog(@"localized name: %@", TISGetInputSourceProperty(source, kTISPropertyLocalizedName));

我引用的是(“现代”)碳函数: #import <Carbon/Carbon.h>

文档:(不提x86与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)

我不能在x86_64编译器中使用TIS吗?

感谢Bavarious对qusetion的评论,添加了Carbon.framework而不只是#include它。 给出真正的Stack Overflow Answer ,我会投票赞成!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM