undefined symbol: _ZTINSt6thread6_StateE

Exception: /usr/local/lib/lib*.so: undefined symbol: _ZTINSt6thread6_StateE

這兩天被這個坑慘了...
其實是gcc版本的問題,是編譯的某個庫的gcc與現在調用的gcc版本不致,我調用的gcc是

gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609

當改爲:

gcc (Ubuntu/Linaro 6.5.0-2ubuntu1~16.04) 6.5.0 20181026

問題就直接解決了.

安裝gcc-6的步驟如下:

sudo apt-get update 
sudo apt-get install build-essential software-properties-common -y 
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y 
sudo apt-get update 
sudo apt-get install gcc-snapshot -y 
sudo apt-get update 
sudo apt-get install gcc-6 g++-6 -y 
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章