[英]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.