I think you're using NVIDIA's libGL libraries instead of Mesa's.
You can work around the problem by preloading Mesa's libraries, e.g. doing something like:
(on a 64bit x86 system) export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
or (on a 32bit x86 system) export LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1
then recompile, and the program will run with no issues.
Make sure to do that every time you need to run that program.
I think you're using NVIDIA's libGL libraries instead of Mesa's.
You can work around the problem by preloading Mesa's libraries, e.g. doing something like:
(on a 64bit x86 system) /usr/lib/ x86_64- linux-gnu/ mesa/libGL. so.1
export LD_PRELOAD=
or (on a 32bit x86 system) /usr/lib/ i386-linux- gnu/mesa/ libGL.so. 1
export LD_PRELOAD=
then recompile, and the program will run with no issues.
Make sure to do that every time you need to run that program.