OpenGL error when building PCL with C++11 support

I am trying to build PCL 1.7.2 from source with C++11 flags enabled. Build fails when linker tries to link pcl_openni_save_image and gives error:

/usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to `drmCloseOnce'
/usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to `drmMap'
/usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to `drmUnmap'
/usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to `drmOpenOnce'

I noticed others had this problem before (https://devtalk.nvidia.com/default/topic/946136/?comment=4910298). They suggest to change symbolic link of libGL.so from mesa/libGL.so to tegra/libGL.so. But I don’t have tegra folder inside /usr/lib.

I think mesa/libGL.so has some conflict with other libs. Where can I find compatible libGL.so library to point?

I also ran into the same issue while trying to build PCL 1.8 from source.

I ended up symlinking libGL.so from /usr/lib to /usr/lib/aarch64-linux-gnu:

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

Thanks! Worked for me as well! Autoware now builds succesfully!