Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]failing to compile my first qt app
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]failing to compile my first qt app

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 951 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thrax
    wrote on 4 Feb 2014, 18:08 last edited by
    #1

    hello guys i'm a complete newbie i barely installed qt5 armed with " C++ GUI Programming with QT 4 (2nd edition) i tried my first app but i can't make it compile here's the output
    @
    18:56:31: Running steps for project test...
    18:56:31: Configuration unchanged, skipping qmake step.
    18:56:31: Starting: "/usr/bin/make"
    /opt/Qt5.2.0/5.2.0/gcc/bin/qmake -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug -o Makefile ../test/test.pro
    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/opt/Qt5.2.0/5.2.0/gcc/mkspecs/linux-g++ -I../test -I/opt/Qt5.2.0/5.2.0/gcc/include -I/opt/Qt5.2.0/5.2.0/gcc/include/QtWidgets -I/opt/Qt5.2.0/5.2.0/gcc/include/QtGui -I/opt/Qt5.2.0/5.2.0/gcc/include/QtCore -I. -I. -o main.o ../test/main.cpp
    g++ -Wl,-rpath,/opt/Qt5.2.0/5.2.0/gcc -Wl,-rpath,/opt/Qt5.2.0/5.2.0/gcc/lib -o test main.o -L/opt/Qt5.2.0/5.2.0/gcc/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: cannot find -lGL
    collect2: error: ld returned 1 exit status
    make: *** [test] Error 1
    18:56:34: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project test (kit: Desktop Qt 5.2.0 GCC 32bit)
    When executing step 'Make'
    18:56:34: Elapsed time: 00:02.
    @
    here's the test.pro code :
    @
    SOURCES +=
    main.cpp
    QT+=widgets
    @
    and the main.cpp code :
    @
    #include <QApplication>
    #include <QLabel>
    int main(int argc,char *argv[]){
    QApplication app(argc,argv);
    QLabel * label = new QLabel("hello world");
    label->show();
    return app.exec();
    }
    @
    dunno if it matter ,i'm using ubuntu saucy 13.10, x86 if somebody can help with this and thx.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hskoglund
      wrote on 4 Feb 2014, 18:54 last edited by
      #2

      Hi, I had the same problem last year (and I got help from this forum). Probably you're lacking some bits, type in following in Terminal:

      @sudo apt-get install g++ libglu1-mesa-dev@

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thrax
        wrote on 4 Feb 2014, 19:05 last edited by
        #3

        thx dude apparently opengl was missing now it works fine)

        1 Reply Last reply
        0

        1/3

        4 Feb 2014, 18:08

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved