1
votes

Qt 5.7.0 GCC 4.9.1 I created a simple widget project (no single code written, no settings changed, only drag a few controls to the form) right after installing Qt and did a test compile. I got error messages:

:-1: error: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL
:-1: error: skipping incompatible /lib/libGL.so when searching for -lGL
:-1: error: skipping incompatible /usr/lib/libGL.so when searching for -lGL 
:-1: error: cannot find -lGL
:-1: error: collect2: error: ld returned 1 exit status

I reckon that it was trying to link to the 32 bit OpenGL in my 64 bit machine. /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so is indeed located in /usr/lib/libGL. The 64 bit version, I think, is the one in /usr/lib64/libGL. How can I change the linking path so that it will link to the right library?

2

2 Answers

3
votes

This seems like you are missing libraries needed to compile 32-bit binaries.

Try running:

sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686
0
votes

this is how I solved this problem.

  1. locate libGL.so and find the right 64 bit version (I used the latest);
  2. create a link in the Qt lib path: ln -s /usr/lib64/libGL.so.352.79 ~/Qt/5.7/gcc_64/lib/libGL.so