我正在使用Mac OS X 10.8.2,并且正在使用scons编译器编译我的代码。 我正在使用32位xerces-c数据库版本2.8.0。使用scons编译器编译C++
当我试图建立我得到的错误:
$scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... ld: warning: ignoring file /usr/xerces-c_2_8_0-x86-macosx-gcc_4_0/lib/libxerces-c.dylib, file was built for unsupported file format (0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0) which is not the architecture being linked (x86_64): /usr/xerces-c_2_8_0-x86-macosx-gcc_4_0/lib/libxerces-c.dylib ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status scons: *** [wntevo] Error 1 scons: building terminated because of errors.
我检查了我libxerces-c.28.0.dylib文件:
$file libxerces-c.28.0.dylib libxerces-c.28.0.dylib: Mach-O dynamically linked shared library i386
我应该添加到我的SConstruct文件,以使它是在x86_64机器上的i386中构建的?
scons不是C++编译器。 –
如果您向我们展示SConsctruct,我们可以提供更好的帮助。听起来你正在试图编译一个64位库的32位应用程序。 – Brady
我对scons的了解可以放在邮票上......但是我认为这里有一个makefile文件,你可以在其中指定标志并传递-m32(我认为...不要引用我。)会强制编译器进入32位模式,否则也许i386弓可以指定...类似的东西 –