centos7 ./code-server: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found 解決方法

前言

最近聽朋友說有個vscode(code-server github項目地址),只要在服務器上搭好,就可以隨時用瀏覽器上去擼代碼。
然後在虛擬機裏試了試跑不起來。

問題

[root@localhost code-server1.939-vsc1.33.1-linux-x64]# ./code-server
./code-server: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./code-server)
./code-server: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./code-server)
./code-server: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./code-server)

環境:

  • 系統:Centos 7.5(1804)
  • GCC版本:4.8.5

第一步:

  • 檢查本地是否有對應的運行庫(libstdc++.so.6.0.21及以上)
    find / -name "libstdc++.so.6*"
    
  • 如果沒有對應版本的運行庫

    獲取libstdc++.so.6.0.25版本庫

    1. 方法一
      wget https://adbin.top/packages/lib64.tar.gz
      
    2. 方法二
      編譯安裝更新版本的gcc
      gcc8.2.0編譯安裝教程:地址

第二步:

cd /usr/lib64
cp libstdc++.so.6 libstdc++.so.6.bak
rm libstdc++.so.6
ln -s (對應路徑)/libstdc++.so.6.0.25(對應版本即可,gcc8.2.0帶的是libstdc++.so.6.0.25) libstdc++.so.6

檢驗是否成功,運行code-server:

[root@localhost code-server1.939-vsc1.33.1-linux-x64]# ./code-server
(node:11491) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
INFO  code-server v1.939-vsc1.33.1
INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/root/.local/share/code-server","extensions-dir":"/root/.local/share/code-server/extensions","working-dir":"/home/test1/date/code-server1.939-vsc1.33.1-linux-x64","log-dir":"/root/.cache/code-server/logs/20190427090540573"}
INFO  Starting webserver... {"host":"0.0.0.0","port":8443}
WARN  No certificate specified. This could be insecure.
WARN  Documentation on securing your setup: https://github.com/codercom/code-server/blob/master/doc/security/ssl.md
INFO
INFO  Password: d58658e46d3a5b4adf6f8874
INFO
INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO
INFO  Starting shared process [1/5]...
WARN  stderr {"data":"(node:11504) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.\n"}
INFO  Connected to shared process

運行成功!!!code-server
用瀏覽器登上去試試:
code-server

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章