导入framework objective-c时出错

导入framework objective-c时出错,objective-c,macos,frameworks,mac-frameworks,Objective C,Macos,Frameworks,Mac Frameworks,我正在尝试添加TCMPortMapper(http://code.google.com/p/tcmportmapper/) 我在构建阶段链接了框架,并尝试运行示例代码: #import <Foundation/Foundation.h> #import <TCMPortMapper/TCMPortMapper.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[N

我正在尝试添加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;
}
我猜这与框架有关,而不是我。但我花了很多时间在谷歌上搜索 除了可能是32位和64位模式之外,没有出现太多

任何帮助都将非常感谢,因为我已经被困在这三天了

谢谢,
您是否正在使用TCPPortMapper的二进制版本?它没有x86_64 arch可执行文件

$ file TCMPortMapper.framework/TCMPortMapper
TCMPortMapper.framework/TCMPortMapper: Mach-O universal binary with 2 architectures
TCMPortMapper.framework/TCMPortMapper (for architecture ppc):   Mach-O dynamically linked shared library ppc
TCMPortMapper.framework/TCMPortMapper (for architecture i386):  Mach-O dynamically linked shared library i386

将GCC“-m32”或“-arch i386”选项添加到CFLAGS和LDFLAGS,或者自己为x86_64 arch构建TCPPortMapper。

OP很可能已经在构建i386和x86_64。OP可以从构建设置中删除x86_64体系结构,以强制其计算机运行i386体系结构,但构建框架的i386/x86_64通用版本将是更好的解决方案。此外,将部署目标设置为10.5或10.4也会更好。
$ file TCMPortMapper.framework/TCMPortMapper
TCMPortMapper.framework/TCMPortMapper: Mach-O universal binary with 2 architectures
TCMPortMapper.framework/TCMPortMapper (for architecture ppc):   Mach-O dynamically linked shared library ppc
TCMPortMapper.framework/TCMPortMapper (for architecture i386):  Mach-O dynamically linked shared library i386