PDA

View Full Version : /usr/bin/ld: cannot find -lglfw3 collect2: error: ld returned 1 exit status



Rahul04789
April 16th, 2017, 04:05 PM
Hi All,

I compiled an OpenGL (.cpp) programme and I got the following error:

compilation: # g++ ex1.cpp -o ex1 -lGLEW -lglfw3 -lGL -lX11 -lXi -lXrandr -lXxf86vm -lXinerama -lXcursor -lrt -lm -pthread -ldl -std=c++11

error:

/usr/bin/ld: cannot find -lglfw3
collect2: error: ld returned 1 exit status

I have already installed libglew-dev package.

Regards,

steeldriver
April 16th, 2017, 04:31 PM
What about libglfw3-dev ?

Rahul04789
April 17th, 2017, 04:30 PM
Yes libglfw3-dev is also installed.

halogen2
April 17th, 2017, 09:56 PM
I had a similar problem compiling software, and the issue was that I was doing a static build which needed libraries that weren't available in .a format.

Could something like this be happening to you?

Also, does directly running ld (adding your own custom ld flags) give any insight? -

ld -lglfw3 --verbose