我遇到问题:我使用Boost编写代码(locks.hpp
)。我的服务器正在运行x64 Ubuntu(Linux)。当我编译这个代码与-m64
,它建立罚款。但是,当我尝试编译为-m32
,我得到这些错误:G ++无法使用Boost for x86编译代码
g++ -fPIC -m32 -shared -Wl,-soname,test.so -ldl -o test.so test.cpp -lboost_thread
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libboost_thread.so when searching for -lboost_thread
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libboost_thread.a when searching for -lboost_thread
/usr/bin/ld: skipping incompatible //usr/lib/libboost_thread.so when searching for -lboost_thread
/usr/bin/ld: skipping incompatible //usr/lib/libboost_thread.a when searching for -lboost_thread
/usr/bin/ld: cannot find -lboost_thread
collect2: ld returned 1 exit status
我在做什么错?谢谢!
虽然我有G ++没有经验:是有可能,你有升压没有32位版本(有点我会怎样解释“不兼容东西“)... – MFH 2012-07-08 22:04:59
你确定你安装了32位boost库吗? – fvu 2012-07-08 22:05:06
@fvu你能给我一个命令来安装32位升压库在X64 Ubuntu的? – Robert 2012-07-08 22:35:10