libstdc++: DSO missing from command line

前端 未结 4 2097
无人及你
无人及你 2021-02-19 00:29

I am having trouble implementing a gtkmm application\'s makefile. I have implemented a simple solution, however, I am getting the following error:

g++ -Wall

相关标签:
4条回答
  • 2021-02-19 01:04

    I had the same issue, in my case the problem was writing gcc instead of g++

    0 讨论(0)
  • 2021-02-19 01:17

    I had a similar problem when compiling zeromq (zmq) into my project. Adding -lstdc++ to the link line in my makefile solved the problem.

    0 讨论(0)
  • 2021-02-19 01:19

    I met the same issue when built openCV libraries

    $ gcc DisplayImage.cpp `pkg-config opencv --libs --cflags` -o DisplayImage
    /usr/bin/ld: /tmp/ccbyJ7Ms.o: undefined reference to symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev@@GLIBCXX_3.4.21'
    //usr/lib/i386-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    

    [SOLVE]

    For gcc try adding -lstdc++ to your command.

    $ gcc DisplayImage.cpp `pkg-config opencv --libs --cflags` -o DisplayImage -lstdc++
    

    For g++ it will link libstdc.so.6++ automatically

    $ g++ DisplayImage.cpp `pkg-config opencv --libs --cflags` -o DisplayImage
    
    0 讨论(0)
  • 2021-02-19 01:29

    I had same problem it was solved by addiing -lstdc++ in command line.

    0 讨论(0)
提交回复
热议问题