命令"/usr/bin/clang++ -bundle -undefined..."失败,退出状态为 1

Command "/usr/bin/clang++ -bundle -undefined..." failed with exit status 1

本文关键字:退出 状态 失败 -bundle usr bin clang++ 命令 -undefined      更新时间:2023-10-16

我正在尝试构建一个引用OS X Maverick中c ++"boost"的库"cmappertools",并遇到以下错误。我对python和c ++ boost都很陌生,甚至不知道从哪里开始寻找:"UnixCCompiler缺少compiler_cxx修复"错误似乎并没有将我指向任何地方。知道吗?

checking for exit in -lboost_thread-mt... yes
checking whether the Boost::Chrono library is available... yes
checking for exit in -lboost_chrono-mt... yes
checking whether C++ compiler accepts -fvisibility=hidden... yes
checking whether C++ compiler accepts -fno-common... yes
checking whether C++ compiler accepts -fvisibility-inlines-hidden... yes

building extension "cmappertools" sources
build_src: building npy-pkg config files
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
**#### ['/usr/bin/clang', '-fno-strict-aliasing', '-fno-common', '-dynamic', '-arch', 'i386', '-arch', 'x86_64', '-g', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-Wstrict-prototypes'] #######
Missing compiler_cxx fix for UnixCCompiler**
customize UnixCCompiler using build_ext
building 'cmappertools' extension
compiling C++ sources
C compiler: /usr/bin/clang++ -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -    DNDEBUG -g -fwrapv -O3 -Wall
compile options: '-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-    packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
extra options: '-pthread -I/usr/local/include -fvisibility=hidden -fno-common -fvisibility-inlines-    hidden -ffunction-sections -fdata-sections'
clang++: cmappertools.cpp
/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/cmappertools.o -o build/lib.macosx-10.6-intel-2.7/cmappertools.so -L/usr/local/lib -    lboost_thread-mt -lboost_chrono-mt -Wl,-s
ld: warning: option -s is obsolete and being ignored
ld: warning: ignoring file /usr/local/lib/libboost_thread-mt.dylib, file was built for x86_64 which         is not the architecture being linked (i386): /usr/local/lib/libboost_thread-mt.dylib
ld: warning: ignoring file /usr/local/lib/libboost_chrono-mt.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libboost_chrono-mt.dylib
ld: internal error: atom not found in     symbolIndex(__ZN5boost16exception_detail20copy_boost_exceptionEPNS_9exceptionEPKS1_) for architecture     i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: option -s is obsolete and being ignored
ld: warning: ignoring file /usr/local/lib/libboost_thread-mt.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libboost_thread-mt.dylib
ld: warning: ignoring file /usr/local/lib/libboost_chrono-mt.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libboost_chrono-mt.dylib
ld: internal error: atom not found in     symbolIndex(__ZN5boost16exception_detail20copy_boost_exceptionEPNS_9exceptionEPKS1_) for architecture     i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Command "/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g     build/temp.macosx-10.6-intel-2.7/cmappertools.o -o build/lib.macosx-10.6-intel-2.7/cmappertools.so -L/usr/local/lib -lboost_thread-mt -lboost_chrono-mt -Wl,-s" failed with exit status 1

您需要以组合的 32/64 位编译 boost - 它仅针对 64 位模式编译。

如果您通过 brew 安装了 boost,您应该在安装命令中添加了 --universal 选项。

如果您手动构建 boost,您应该添加以下选项:

address-model=32_64 architecture=x86

b2编译行。这将导致它以32位和64位构建,这应该支持你的python构建。