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


I was able to run every project of this tutorial:
This week I had to reflash my JetsonTX2. I followed this guide step by step:

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/’ failed
make[2]: *** [aarch64/lib/] 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/*
lrwxrwxrwx 1 root root     14 May 10  2019 /usr/lib/aarch64-linux-gnu/ ->
lrwxrwxrwx 1 root root     14 May 10  2019 /usr/lib/aarch64-linux-gnu/ ->
-rw-r--r-- 1 root root 972968 May 10  2019 /usr/lib/aarch64-linux-gnu/

Sure! My output is:

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

OK, try running this:

sudo rm /usr/lib/aarch64-linux-gnu/
sudo ln -s /usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu/

That should restore your 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/, 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:
I followed the instructions, so I use this command: “git clone” to get the project. I think I used the latest version.