GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

前端 未结 4 1911
时光取名叫无心
时光取名叫无心 2021-02-14 02:30

Apologies, I understand questions very similar to this have been asked relatively often, although none of the solutions seem to work for me.When attempting to run any c++ code o

4条回答
  •  粉色の甜心
    2021-02-14 03:02

    So I was having the same error on ubuntu 18.04, and these are the steps to fix it:

    1. Run this to check the what is missing
    strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
    

    You will get something like

    GLIBCXX_3.4
    GLIBCXX_3.4.1
    GLIBCXX_3.4.2
    GLIBCXX_3.4.3
    GLIBCXX_3.4.4
    GLIBCXX_3.4.5
    GLIBCXX_3.4.6
    GLIBCXX_3.4.7
    GLIBCXX_3.4.8
    GLIBCXX_3.4.9
    GLIBCXX_3.4.10
    GLIBCXX_3.4.11
    GLIBCXX_3.4.12
    GLIBCXX_3.4.13
    GLIBCXX_3.4.14
    GLIBCXX_3.4.15
    GLIBCXX_3.4.16
    GLIBCXX_3.4.17
    GLIBCXX_3.4.18
    GLIBCXX_3.4.19
    GLIBCXX_3.4.20
    GLIBCXX_3.4.21
    GLIBCXX_DEBUG_MESSAGE_LENGTH
    

    Then run:

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test

    sudo apt-get update

    sudo apt-get install gcc-5

    sudo apt-get upgrade libstdc++6

    At least run again to confirm the changes

    strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
    
    

提交回复
热议问题