/usr/lib/libgflags.so.2.2: error adding symbols: DSO missing from command line

I understand that this issue may not be directly linked with the ZED SDK but it may be an issue people can encounter when building the zed-openpose program.

I am trying to build the program on a Jetson Nano with ubuntu 18.04.

Here you can find the output:

Consolidate compiler generated dependencies of target zed_openpose
[ 33%] Linking CXX executable zed_openpose
/usr/bin/ld: CMakeFiles/zed_openpose.dir/src/main.o: undefined reference to symbol ‘ZN6google14FlagRegistererC1IbEEPKcS3_S3_PT_S5
//usr/lib/aarch64-linux-gnu/libgflags.so.2.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/zed_openpose.dir/build.make:144: recipe for target ‘zed_openpose’ failed
make[2]: *** [zed_openpose] Error 1
CMakeFiles/Makefile2:82: recipe for target ‘CMakeFiles/zed_openpose.dir/all’ failed
make[1]: *** [CMakeFiles/zed_openpose.dir/all] Error 2
Makefile:90: recipe for target ‘all’ failed
make: *** [all] Error 2

I tried to reinstall caffe and gflags but I am still getting the same issue.

Thank you for your help and time.

For anyone looking for the answer: