我遇到問題:我使用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