我在 ubuntu 20.04 上运行 cmake 然后 make 时出现此错误
[100%] Linking CXX executable ./tmp/DearPyGuiDearSandbox/DearSandbox
/usr/bin/ld: cannot find -lpython3.9d
collect2: error: ld returned 1 exit status
make[2]: *** [sandbox/CMakeFiles/DearSandbox.dir/build.make:102: ./tmp/DearPyGuiDearSandbox/DearSandbox] Error 1
make[1]: *** [CMakeFiles/Makefile2:218: sandbox/CMakeFiles/DearSandbox.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
我已经尝试将它们包含在 CMakeLists.txt 中,但没有成功
include_directories(/usr/include/python3.9)
include_directories(./miniconda3/envs/ngp/lib/python3.9/)
include_directories(/usr/lib/x86_64-linux-gnu/)
include_directories(/usr/share/doc/libpython3.9)
include_directories(/usr/share/doc/libpython3.9-dev
答案1
要确定哪些软件包包含缺失的文件,请安装 apt-file
sudo apt-get install apt-file
然后更新搜索数据库:
apt-file update
然后你可以搜索该文件:
apt-file search libpython3.9d
识别 libpython3.9-dbg 包,然后您可以安装它。