Unable to Build jetson_multimedia_api

On a Jetson AGX Orin running Jetpack 5.1.1 (L4T 35.3.1) I am unable to compile the jetson_multimedia_api samples. When trying to run sudo makeI get the error:

> sudo make
Make in samples/00_video_decode
make[1]: Entering directory '/usr/src/jetson_multimedia_api/samples/00_video_decode'
Linking: video_decode
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: cannot find -lGLESv2
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:53: video_decode] Error 1
make[1]: Leaving directory '/usr/src/jetson_multimedia_api/samples/00_video_decode'
make: *** [Makefile:59: all] Error 1

Hi,

Try installing the missing libraries:

sudo apt install libegl-dev libgles-dev

Thanks for the reply! I have confirmed that these are already installed:

 !w /usr/src/jetson_multimedia_api/samples/00_video_decode .................................................................................................................................................................................................. ubuntu@EAC-5000 | 10:31:23 
> sudo apt install libegl-dev libgles-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libegl-dev is already the newest version (1.3.2-1~ubuntu0.20.04.2).
libegl-dev set to manually installed.
libgles-dev is already the newest version (1.3.2-1~ubuntu0.20.04.2).
libgles-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

 !w /usr/src/jetson_multimedia_api/samples/00_video_decode .................................................................................................................................................................................................. ubuntu@EAC-5000 | 10:31:25 
> sudo make                              
Linking: video_decode
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: cannot find -lGLESv2
collect2: error: ld returned 1 exit status
make: *** [Makefile:53: video_decode] Error 1

Chan you share the output from:

sudo find / -name libGLESv2.so

It looks like the only exist in a docker container running on the board:

/var/lib/docker/overlay2/2943660e1e1f2149d68a05d0d134945ed8f0f365a620647afe4e6c3f03d5fb79/diff/usr/lib/aarch64-linux-gnu/libGLESv2.so
/var/lib/docker/overlay2/70f868a74548615928d0efc7d4fb71d01fd17bb547d89eb1624977e651477e3e/merged/usr/lib/aarch64-linux-gnu/libGLESv2.so
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied

@miguel.taylor an update: I copied the /usr/lib/aarch64-linux-gnu/libGLESv2.so file out of the container, to the same location on the host: /usr/lib/aarch64-linux-gnu/libGLESv2.so, and tried to make again. I was left with:

> sudo make
Linking: video_decode
/usr/bin/ld: cannot find -lEGL
collect2: error: ld returned 1 exit status
make: *** [Makefile:53: video_decode] Error 1

When comparing the host to the container, I found -lEGL to be file /usr/lib/aarch64-linux-gnu/libEGL.so. Copying this to the host, i can build sample 00 !! Thank you @miguel.taylor !

after the above steps, i had to run the following to get the rest of the samples compiling (at the very least for /usr/src/jetson_multimedia_api/samples/04_video_dec_trt):

sudo apt-get install nvidia-tensorrt libnvinfer-dev

Now, all samples compile successfully!