【发布时间】:2011-09-07 09:24:54
【问题描述】:
我正在尝试添加 TCMPortMapper (http://code.google.com/p/tcmportmapper/)
我已在构建阶段链接框架并尝试运行示例代码:
#import <Foundation/Foundation.h>
#import <TCMPortMapper/TCMPortMapper.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
TCMPortMapper *pm = [TCMPortMapper sharedInstance];
[pm addPortMapping:
[TCMPortMapping portMappingWithLocalPort:13478
desiredExternalPort:4321
transportProtocol:TCMPortMappingTransportProtocolTCP
userInfo:nil]];
[pm start];
[pool drain];
return 0;
}
但我得到了错误:
ld: warning: ignoring file /Applications/TCMPortMapper.framework/TCMPortMapper, missing required
architecture x86_64 in file
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_TCMPortMapper", referenced from:
objc-class-ref in main.o
"_OBJC_CLASS_$_TCMPortMapping", referenced from:
objc-class-ref in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我猜它与框架有关,而不是我。但是我花了很多时间在谷歌上搜索 除了可能是 32 位和 64 位模式之外,并没有出现太多。
非常感谢任何帮助,因为我已经坚持了 3 天。
谢谢, 会
【问题讨论】:
标签: objective-c macos frameworks mac-frameworks