libpthread.so.0: error adding symbols: DSO missing from command line

前端 未结 14 1006
长情又很酷
长情又很酷 2020-11-22 07:00

When I\'m compiling openvswitch-1.5.0, I\'ve encountered the following compile error:

 gcc -Wstrict-prototypes -Wall -Wno-sign-compare -Wpointer-arith
     -         


        
14条回答
  •  终归单人心
    2020-11-22 07:21

    Background

    The DSO missing from command line message will be displayed when the linker does not find the required symbol with it's normal search but the symbol is available in one of the dependencies of a directly specified dynamic library.

    In the past the linker considered symbols in dependencies of specified languages to be available. But that changed in some later version and now the linker enforces a more strict view of what is available. The message thus is intended to help with that transition.

    What to do?

    If you are the maintainer of the software

    You should solve this problem by making sure that all libraries that are needed to satisfy the needed symbols are directly specified on the linker command line. Also keep in mind that order often matters.

    If you are just trying to compile the software

    As a workaround it's possible to switch back to the more permissive view of what symbols are available by using the option -Wl,--copy-dt-needed-entries.

    Common ways to inject this into a build are to export LDFLAGS before running configure or similar like this:

    export LDFLAGS="-Wl,--copy-dt-needed-entries"
    

    Sometimes passing LDFLAGS="-Wl,--copy-dt-needed-entries" directly to make might also work.

提交回复
热议问题