[英]failed to build shared libraries with boost 1.48
我正在嘗試在amd64機器上構建boost 1.48,但是由於重定位錯誤而未構建共享庫。 我假設由於-fPIC
,這是無法解決該問題的原因。
更具體地說,這是我從行李箱得到的動力,
$ ./b2
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(codecvt.o): relocation R_X86_64_32S against `vtable for std::codecvt<wchar_t, char, __mbstate_t>' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
我也嘗試過這些
./bjam -d2
./bjam address-model=64 cxxflags=-fPIC
如此處解釋/討論
http://boost.2283326.n4.nabble.com/fPIC-option-for-boost-td3176976.html
但是沒有幫助。 我無法建立使用boostrap.sh
配置的共享庫。
我在嘗試在標准的debian squeeze安裝上構建mosh-1.2.2時遇到類似的問題。 以下為我工作:
# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# rm libstdc++.so
# ln -s ../../../x86_64-linux-gnu/libstdc++.so.6 libstdc++.so
為了更詳細地說明,現有的符號鏈接指向一個不存在的文件:
# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# ls -l libstdc++.so
..
lrwxrwxrwx 1 root root 23 May 3 2011 libstdc++.so -> ../../../libstdc++.so.6
..
我找到了正確的文件位置
# dpkg -S 'libstdc'
..
libstdc++6: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
..
然后按照第一個代碼段中所述修復符號鏈接。
我在編譯過程中遇到的錯誤是:
make[3]: *** [mosh-client] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(functexcept.o): relocation R_X86_64_32 against `std::bad_typeid::~bad_typeid()' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
不知道這個特定的debian squeeze服務器是如何崩潰的。 我一直在毫無疑問地在其他擠壓系統上進行編譯。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.