我正在尝试添加 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 天。
谢谢,威尔