Error: /usr/bin/ld: cannot find -lGL
I installed latest Qt 5 for Linux and tried to test by simply dragging and dropping a pushbutton and build. But it throws an error. I didn't get any idea. Here's the compile output:
Quote:
11:54:57: Running steps for project Test...
11:54:57: Starting: "/usr/bin/make" clean -w
make: Entering directory `/home/tom/Data/Qt5/Test-build-Desktop_Qt_5_0_0_GCC_32bit_SDK-Debug'
rm -f moc_widget.cpp
rm -f ui_widget.h
rm -f main.o widget.o moc_widget.o
rm -f *~ core *.core
make: Leaving directory `/home/tom/Data/Qt5/Test-build-Desktop_Qt_5_0_0_GCC_32bit_SDK-Debug'
11:54:57: The process "/usr/bin/make" exited normally.
11:54:57: Configuration unchanged, skipping qmake step.
11:54:57: Starting: "/usr/bin/make" -w
make: Entering directory `/home/tom/Data/Qt5/Test-build-Desktop_Qt_5_0_0_GCC_32bit_SDK-Debug'
/home/tom/Programs/Qt/5.0.0/gcc/bin/uic ../Test/widget.ui -o ui_widget.h
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../Programs/Qt/5.0.0/gcc/mkspecs/linux-g++ -I../Test -I../../../Programs/Qt/5.0.0/gcc/include -I../../../Programs/Qt/5.0.0/gcc/include/QtWidgets -I../../../Programs/Qt/5.0.0/gcc/include/QtGui -I../../../Programs/Qt/5.0.0/gcc/include/QtCore -I. -I. -I. -o main.o ../Test/main.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../Programs/Qt/5.0.0/gcc/mkspecs/linux-g++ -I../Test -I../../../Programs/Qt/5.0.0/gcc/include -I../../../Programs/Qt/5.0.0/gcc/include/QtWidgets -I../../../Programs/Qt/5.0.0/gcc/include/QtGui -I../../../Programs/Qt/5.0.0/gcc/include/QtCore -I. -I. -I. -o widget.o ../Test/widget.cpp
/home/tom/Programs/Qt/5.0.0/gcc/bin/moc -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../Programs/Qt/5.0.0/gcc/mkspecs/linux-g++ -I../Test -I../../../Programs/Qt/5.0.0/gcc/include -I../../../Programs/Qt/5.0.0/gcc/include/QtWidgets -I../../../Programs/Qt/5.0.0/gcc/include/QtGui -I../../../Programs/Qt/5.0.0/gcc/include/QtCore -I. -I. -I. ../Test/widget.h -o moc_widget.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../Programs/Qt/5.0.0/gcc/mkspecs/linux-g++ -I../Test -I../../../Programs/Qt/5.0.0/gcc/include -I../../../Programs/Qt/5.0.0/gcc/include/QtWidgets -I../../../Programs/Qt/5.0.0/gcc/include/QtGui -I../../../Programs/Qt/5.0.0/gcc/include/QtCore -I. -I. -I. -o moc_widget.o moc_widget.cpp
g++ -Wl,-rpath,/home/tom/Programs/Qt/5.0.0/gcc -Wl,-rpath,/home/tom/Programs/Qt/5.0.0/gcc/lib -o Test main.o widget.o moc_widget.o -L/home/tom/Programs/Qt/5.0.0/gcc/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
/usr/bin/ld: cannot find -lGL
make: Leaving directory `/home/tom/Data/Qt5/Test-build-Desktop_Qt_5_0_0_GCC_32bit_SDK-Debug'
collect2: ld returned 1 exit status
make: *** [Test] Error 1
11:55:00: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Test (kit: Desktop Qt 5.0.0 GCC 32bit (SDK))
When executing step 'Make'
Re: Error: /usr/bin/ld: cannot find -lGL
take the GL dependency out of your pro file
Re: Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
amleto
take the GL dependency out of your pro file
Could you please tell how do I do that? I'm a newbie.
Re: Error: /usr/bin/ld: cannot find -lGL
Add in pro file LIBS += -lGL
Re: Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
tomkonikkara
Could you please tell how do I do that? I'm a newbie.
Somewhere in your project file there is something similar to:
Remove it and rerun qmake.
Re: Error: /usr/bin/ld: cannot find -lGL
I tried both, but still not works.
This is my pro file:
Quote:
#-------------------------------------------------
#
# Project created by QtCreator 2012-12-25T10:45:20
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Test
TEMPLATE = app
SOURCES += main.cpp\
widget.cpp
HEADERS += widget.h
FORMS += widget.ui
Re: Error: /usr/bin/ld: cannot find -lGL
It seems that by default QtWidgets requires OpenGL. In that case do you have OpenGL installed? Can you find a file called libGL.so in your system?
Re: Error: /usr/bin/ld: cannot find -lGL
Hi i have some problem my .pro
Code:
#-------------------------------------------------
#
# Project created by QtCreator 2012-12-27T13:59:39
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled1
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
ANd i have in system
libGL.so.1 and libGL.so.1.2.0
System: Linux Ubuntu 12.10
Re: Error: /usr/bin/ld: cannot find -lGL
And why are you trying to hijack this thread instead of starting your own?
Re: Error: /usr/bin/ld: cannot find -lGL
Because author has same problems and he hasn't written nothing about 2 days.
Re: Error: /usr/bin/ld: cannot find -lGL
We don't know if he has the same problem. You didn't even state what your problem was.
Re: Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
Viper666
ANd i have in system
libGL.so.1 and libGL.so.1.2.0
System: Linux Ubuntu 12.10
BTW. You need libGL.so, not libGL.so.1. One should be a symlink to the other though (try running ldconfig as root and see if the link gets created).
Re: Error: /usr/bin/ld: cannot find -lGL
same problem using a fresh qt5 linux install.
I resolve this problem delete the -lGL option in the makefile generated in qmake. whis is a workaround but dor the moment works for me.
just search the -lGL option in Makefile and delete the text.
Re: Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
ecanela
same problem using a fresh qt5 linux install.
This is not about Qt5. It is your system that is missing a library it is supposed to have. Reinstalling Qt won't help here. You need to install libmesa or accelerated NVIDIA drivers (in case you're using a NVIDIA card).
Re: Error: /usr/bin/ld: cannot find -lGL
Hello, I'm finded this problem on lubuntu 13.04 with Qt 5.0.2 when trying to compile my project with widgets and QtWebKit.
Solve this problem by writing command in terminal:
Code:
sudo apt-get install libglu1-mesa-dev
Re: Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
Hronom
Code:
sudo apt-get install libglu1-mesa-dev
Yes, every Ubuntu user needs to install this package before runnin opengl. This would have been very clear from the beginning if you had bothered to google the error..
Re: Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
saman_artorious
Yes, every Ubuntu user needs to install this package before runnin opengl.
No, development packages are not required for running OpenGL.
Re: Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
Hronom
Hello, I'm finded this problem on lubuntu 13.04 with Qt 5.0.2 when trying to compile my project with widgets and QtWebKit.
Solve this problem by writing command in terminal:
Code:
sudo apt-get install libglu1-mesa-dev
Wonderful, thank you. it works for me.
Error: /usr/bin/ld: cannot find -lGL
Quote:
Originally Posted by
tomkonikkara
/usr/bin/ld: cannot find -lGL
meaning the linker misses an OpenGL library.
This happens on fresh installs QT 5.5 on mint 17.2 cinnamon, for example. :confused:
I used synaptic-pack-installer to install
libglfw-dev
header files and static libraries portable framework for OpenGL application development
and
libglfw2
Shared libraries portable framework for OpenGL application development
and that causally fixed it. The wizard apps do build all of a sudden. :rolleyes: