存档问题不是C中链接的体系结构(x86_64)

Red*_*Red 2 c c++ macos makefile

当我在这个程序上运行make我正在尝试构建时,我收到这些警告:

ld: warning: ignoring file ../lib/libiptools.a, file was built for archive which is not the architecture being linked (x86_64)
ld: warning: ignoring file ../lib/libmpeg.a, file was built for archive which is not the architecture being linked (x86_64)
Run Code Online (Sandbox Code Playgroud)

然后它显然无法编译:

ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [iptool] Error 1
Run Code Online (Sandbox Code Playgroud)

我只是很难弄清楚如何改变我的make文件并正确编译,因为我不熟悉档案.任何建议都值得欣赏,因为我确信我错过了一些简单的东西.我正在使用Mac OS X Mountain Lion.

you*_*kme 6

libiptools.a和libmpeg.a编译为32位,但项目的其余部分编译为64位.要么找到这些库的64位版本,要么编译为32位.

  • 由于您使用的是OS X,我假设您正在使用clang进行编译.我对clang没有任何见解.但是尝试用`-arch i386`编译并删除对`-arch x86_64`的任何引用 (2认同)