Jetson inference - /usr/bin/ld: cannot find -lGL

Hi!

I was able to run every project of this tutorial: https://github.com/dusty-nv/jetson-inference
This week I had to reflash my JetsonTX2. I followed this guide step by step: https://github.com/dusty-nv/jetson-inference/blob/master/docs/building-repo-2.md

I got an error at “make” step:

/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
utils/CMakeFiles/jetson-utils.dir/build.make:4801: recipe for target ‘aarch64/lib/libjetson-utils.so’ failed
make[2]: *** [aarch64/lib/libjetson-utils.so] Error 1
CMakeFiles/Makefile2:713: recipe for target ‘utils/CMakeFiles/jetson-utils.dir/all’ failed
make[1]: *** [utils/CMakeFiles/jetson-utils.dir/all] Error 2
Makefile:129: recipe for target ‘all’ failed
make: *** [all] Error 2

Please help me how to solve the problem. Thank you!

Hi @feketegyerek, can you run this ls command below and let me know what the output looks like for you?

$ ls -ll /usr/lib/aarch64-linux-gnu/libGL.so*
lrwxrwxrwx 1 root root     14 May 10  2019 /usr/lib/aarch64-linux-gnu/libGL.so -> libGL.so.1.0.0
lrwxrwxrwx 1 root root     14 May 10  2019 /usr/lib/aarch64-linux-gnu/libGL.so.1 -> libGL.so.1.0.0
-rw-r--r-- 1 root root 972968 May 10  2019 /usr/lib/aarch64-linux-gnu/libGL.so.1.0.0

Sure! My output is:

lrwxrwxrwx 1 root root 14 júl 16 11:21 /usr/lib/aarch64-linux-gnu/libGL.so -> tegra/libGL.so
lrwxrwxrwx 1 root root 14 máj 10 2019 /usr/lib/aarch64-linux-gnu/libGL.so.1 -> libGL.so.1.0.0
-rw-r–r-- 1 root root 972968 máj 10 2019 /usr/lib/aarch64-linux-gnu/libGL.so.1.0.0

OK, try running this:

sudo rm /usr/lib/aarch64-linux-gnu/libGL.so
sudo ln -s /usr/lib/aarch64-linux-gnu/libGL.so.1.0.0 /usr/lib/aarch64-linux-gnu/libGL.so

That should restore your libGL.so link to the correct location.

Is it possible that you were using an old copy of jetson-inference? Long ago, I recall that I used to set that symlink to tegra/libGL.so, but it has since moved so that code from the install script was removed.

Thank you very much! Now, it works.

My system was clear, I followed this tutorial: https://github.com/dusty-nv/jetson-inference/blob/master/docs/building-repo-2.md
I followed the instructions, so I use this command: “git clone https://github.com/dusty-nv/jetson-inference” to get the project. I think I used the latest version.