/usr/bin/ld: cannot find -lGL: No such file or directory

/usr/bin/ld: cannot find -lGL: No such file or directory_第1张图片
sudo apt install --reinstall libgl1-mesa-dev

sudo find /usr/lib/ -name libGL*
# You can look under /usr/lib/x86_64-linux-gnu/ or /usr/lib for the file, remove the symlink currently at /usr/lib/x86_64-linux-gnu/libGL.so and then re-create the symlink to the actual library using
sudo ln sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl1 -y
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so

然后出现了这个问题

[ 97%] Linking CXX shared library pyngp.cpython-39-x86_64-linux-gnu.so

/usr/bin/ld: libngp.a(testbed.cu.o): undefined reference to symbol 'glEnable'

/usr/bin/ld: /lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status

solution: install OpenGL/GLUT libraries

 1596  sudo apt-get install freeglut3-dev
 1597  sudo apt-cache search glut
 1598  dpkg -L freeglut3-dev
 1599  sudo apt-get install libxmu-dev libxi-dev
 1600  sudo apt-get install mesa-utils
 1601  sudo apt-get install freeglut3-dev
 1602  nvidia-smi
 1603  sudo apt-get install aptitude
 1604  sudo aptitude install freeglut3-dev

你可能感兴趣的:(Linux,linux,ubuntu,运维)