gpt4 book ai didi

c++ - make : error adding symbols: DSO missing from command line 时出错

转载 作者:太空宇宙 更新时间:2023-11-04 11:02:14 31 4
gpt4 key购买 nike

我正在尝试编译从 git 存储库(OpenNI2,https://github.com/occipital/OpenNI2)下载的一些代码。运行 make 后出现以下错误:

make -C Source/Tools/NiViewer
make[1]: Entering directory `/home/karnivaurus/Data/Libraries/OpenNI2/Source/Tools/NiViewer'
g++ -o ../../../Bin/x64-Release/NiViewer ./../../../Bin/Intermediate/x64-Release/NiViewer/Device.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Draw.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Keyboard.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Menu.o ./../../../Bin/Intermediate/x64-Release/NiViewer/MouseInput.o ./../../../Bin/Intermediate/x64-Release/NiViewer/NiViewer.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Capture.o -L../../../ThirdParty/PSCommon/XnLib/Bin/x64-Release -L../../../Bin/x64-Release -lglut -lGL -lOpenNI2 -lXnLib -Wl,-rpath ./
/usr/bin/ld: ../../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxMutex.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [../../../Bin/x64-Release/NiViewer] Error 1
make[1]: Leaving directory `/home/karnivaurus/Data/Libraries/OpenNI2/Source/Tools/NiViewer'
make: *** [Source/Tools/NiViewer] Error 2

关于我应该如何解决这个问题有什么想法吗?

最佳答案

您必须将指令“-lpthread”添加到您的编译器,它已解决。

例如,如果您之前的代码是:g++ mycode.cpp -o myexecutable

现在你必须把g++ mycode.cpp -lpthread -o myexecutable

关于c++ - make : error adding symbols: DSO missing from command line 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26526553/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com