[solved ]error when i want run simple qt gui in ubuntu



  • HI, i install qt 5.0.1 on ubuntu. when i create a new project and i want run it has this errors:

    !http://upload7.ir/images/06527886826827024536.jpg(Error)!

    and this is it's output:
    @
    20:43:14: Running steps for project untitled...
    20:43:14: Starting: "/opt/Qt5.0.1/5.0.1/gcc/bin/qmake" /opt/Qt5.0.1/Tools/QtCreator/bin/untitled/untitled.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
    20:43:14: The process "/opt/Qt5.0.1/5.0.1/gcc/bin/qmake" exited normally.
    20:43:14: Starting: "/usr/bin/make" -w
    make: Entering directory /opt/Qt5.0.1/Tools/QtCreator/bin/untitled-build-Desktop_Qt_5_0_1_GCC_32bit-Debug' /opt/Qt5.0.1/5.0.1/gcc/bin/uic ../untitled/mainwindow.ui -o ui_mainwindow.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../../../../5.0.1/gcc/mkspecs/linux-g++ -I../untitled -I../../../../5.0.1/gcc/include -I../../../../5.0.1/gcc/include/QtWidgets -I../../../../5.0.1/gcc/include/QtGui -I../../../../5.0.1/gcc/include/QtCore -I. -I. -I. -o main.o ../untitled/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../../../../5.0.1/gcc/mkspecs/linux-g++ -I../untitled -I../../../../5.0.1/gcc/include -I../../../../5.0.1/gcc/include/QtWidgets -I../../../../5.0.1/gcc/include/QtGui -I../../../../5.0.1/gcc/include/QtCore -I. -I. -I. -o mainwindow.o ../untitled/mainwindow.cpp /opt/Qt5.0.1/5.0.1/gcc/bin/moc -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../5.0.1/gcc/mkspecs/linux-g++ -I../untitled -I../../../../5.0.1/gcc/include -I../../../../5.0.1/gcc/include/QtWidgets -I../../../../5.0.1/gcc/include/QtGui -I../../../../5.0.1/gcc/include/QtCore -I. -I. -I. ../untitled/mainwindow.h -o moc_mainwindow.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../../../../5.0.1/gcc/mkspecs/linux-g++ -I../untitled -I../../../../5.0.1/gcc/include -I../../../../5.0.1/gcc/include/QtWidgets -I../../../../5.0.1/gcc/include/QtGui -I../../../../5.0.1/gcc/include/QtCore -I. -I. -I. -o moc_mainwindow.o moc_mainwindow.cpp g++ -Wl,-rpath,/opt/Qt5.0.1/5.0.1/gcc -Wl,-rpath,/opt/Qt5.0.1/5.0.1/gcc/lib -o untitled main.o mainwindow.o moc_mainwindow.o -L/opt/Qt5.0.1/5.0.1/gcc/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread /usr/bin/ld: cannot find -lGL collect2: ld returned 1 exit status make: Leaving directory/opt/Qt5.0.1/Tools/QtCreator/bin/untitled-build-Desktop_Qt_5_0_1_GCC_32bit-Debug'
    make: *** [untitled] Error 1
    20:43:20: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project untitled (kit: Desktop Qt 5.0.1 GCC 32bit)
    When executing step 'Make'
    @


  • Lifetime Qt Champion

    Hi,

    You are missing the mesa lib package



  • Hi,can you explain more?


  • Lifetime Qt Champion

    The error you are seeing comes from a missing library (your build didn't complete).

    The library in question is libGL that is provided by the mesa lib package on Ubuntu.



  • when i type sudo apt-get install libgl1-mesa-dri it wrote this package is already newest version.


  • Lifetime Qt Champion

    Try libgl1-mesa-dev



  • thanks it worked.


  • Lifetime Qt Champion

    You're welcome !

    You did a little typo in your thread's title, it's solved not salved :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.