vico
vico

Reputation: 18251

Qt can't find GL library

I have installed QT on 64 bit Centos. I got error below while building simple widget form application:

/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [untitled] Error 1
08:17:08: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled (kit: Desktop Qt 5.9.5 GCC 64bit)
When executing step "Make"

Command below

locate *libGL.so*

Brigs

/usr/lib64/libGL.so.1
/usr/lib64/libGL.so.1.2.0

How to fix problem?

Upvotes: 0

Views: 216

Answers (1)

nos
nos

Reputation: 229342

You need the development files, not just the runtime files. When you specify the flag -lGL, the compiler will look for a libGL.so or a libGL.a file to link to.

In this case you would expect the /usr/lib64/libGL.so file to be present.

Run

  yum provides /usr/lib64/libGL.so 

to find which package provides that file. (Or a for a broader search, run yum provides */libGL.so)

Then install that package

  yum install mesa-libGL-devel

Upvotes: 1

Related Questions