Error compiling project in QT Creator

Asked

Viewed 984 times

2

I am seriously wanting to study programming and I chose the QT framework when I was with a dualboot on my computer there was this problem that I am having now after removing the dualboot and install only Ubuntu 14.10.

In Ubuntu installed QT without problem and when compiling the project QT Creator is giving me the error below. How to solve this problem?

04:49:43: Running steps for project untitled1...
04:49:43: Starting: "/home/tandavala/Qt/5.3/gcc/bin/qmake" /home/tandavala/untitled1/untitled1.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
04:49:43: The process "/home/tandavala/Qt/5.3/gcc/bin/qmake" exited normally.
04:49:43: Starting: "/usr/bin/make" 
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../Qt/5.3/gcc/mkspecs/linux-g++ -I../untitled1 -I../Qt/5.3/gcc/include -I../Qt/5.3/gcc/include/QtQuick -I../Qt/5.3/gcc/include/QtQml -I../Qt/5.3/gcc/include/QtWidgets -I../Qt/5.3/gcc/include/QtNetwork -I../Qt/5.3/gcc/include/QtGui -I../Qt/5.3/gcc/include/QtCore -I. -I. -o main.o ../untitled1/main.cpp
/home/tandavala/Qt/5.3/gcc/bin/rcc -name qml ../untitled1/qml.qrc -o qrc_qml.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../Qt/5.3/gcc/mkspecs/linux-g++ -I../untitled1 -I../Qt/5.3/gcc/include -I../Qt/5.3/gcc/include/QtQuick -I../Qt/5.3/gcc/include/QtQml -I../Qt/5.3/gcc/include/QtWidgets -I../Qt/5.3/gcc/include/QtNetwork -I../Qt/5.3/gcc/include/QtGui -I../Qt/5.3/gcc/include/QtCore -I. -I. -o qrc_qml.o qrc_qml.cpp
g++ -Wl,-rpath,/home/tandavala/Qt/5.3/gcc -Wl,-rpath,/home/tandavala/Qt/5.3/gcc/lib -o untitled1 main.o qrc_qml.o   -L/home/tandavala/Qt/5.3/gcc/lib -lQt5Quick -lQt5Qml -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread 
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
Makefile:192: recipe for target 'untitled1' failed
make: *** [untitled1] Error 1
04:49:47: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled1 (kit: Desktop Qt 5.3 GCC 32bit)
When executing step "Make"
04:49:47: Elapsed time: 00:05.
  • Basically your mistake is the /usr/bin/ld: cannot find -lGL.

2 answers

2

Logico this and the problem friend, you know more with a little search I managed to solve only was to type in the terminal sudo sudo apt-get install libqt4-dev and the problem will be solved

0

Your mistake basically is this:

/usr/bin/ld: cannot find -lGL

At this link, I found the following tip:

sudo apt-get install libglu1-mesa-dev -y

Another tip I found on this other link. Take a look at the folder /usr/lib and see if the libGL.so is there. If you are, but with a different name, you can do this:

sudo ln -s /usr/lib/libGL.so.xx.xx.xx /usr/lib/libGL.so

In a question on Stackoverflow in English, someone had the same problem that you and managed to solve. In his case, the libraries were in the folder /usr/lib/nvidia-current, then to resolve, the accepted answer from there suggests something more or less like this:

sudo ln -s /usr/lib/nvidia-current/libGL.so.1 /usr/lib/libGL.so.1
sudo ln -s /usr/lib32/nvidia-current/libGL.so.1 /usr/lib/libGL.so.1
sudo ln -s /usr/lib/nvidia-current/libGL.so /usr/lib/libGL.so
sudo ln -s /usr/lib32/nvidia-current/libGL.so /usr/lib/libGL.so

Maybe this will solve.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.