libstdc++ GLIBCXX version errors

前端 未结 4 1264
野性不改
野性不改 2020-12-05 21:23

when I compile a c++ program in my computer using g++ and transfer the executable to run it on my university server, I get

./main: /usr/lib/libstdc++.so.6:          


        
4条回答
  •  粉色の甜心
    2020-12-05 22:16

    You can copy your version of the /usr/lib/libstdc++.so.6 to a subdirectory of your home directory of the server, say ~/lib and then run:

    $ LD_LIBRARY_PATH=$HOME/lib ./main
    

    Or if you prefer

    $ export LD_LIBRARY_PATH=$HOME/lib
    $ ./main
    

    And the program should load your private library instead of the system one.

提交回复
热议问题