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

前端 未结 14 861
长情又很酷
长情又很酷 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:06

    I also encountered same problem. I do not know why, i just add -lpthread option to compiler and everything ok.

    Old:

    $ g++ -rdynamic -m64 -fPIE -pie  -o /tmp/node/out/Release/mksnapshot ...*.o *.a -ldl -lrt
    

    got following error. If i append -lpthread option to above command then OK.

    /usr/bin/ld: /tmp/node/out/Release/obj.host/v8_libbase/deps/v8/src/base/platform/condition-variable.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
    //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    

提交回复
热议问题