Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building with Qt 5.2.0 under Ubuntu 12.04 compiler flags problem to resolve
Forum Updated to NodeBB v4.3 + New Features

Building with Qt 5.2.0 under Ubuntu 12.04 compiler flags problem to resolve

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 2 Posters 3.3k 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.
  • S Offline
    S Offline
    swhweng
    wrote on last edited by
    #1

    Hi,

    Can anyone guess how to resolve next problem:

    When I build Qt 5.2.0 Widget application:

    I get:

    22:37:59: Running steps for project apptest2...
    22:37:59: Configuration unchanged, skipping qmake step.
    22:37:59: Starting: "/usr/bin/make"
    /home/paulcoder/Qt/5.2.0/gcc/bin/uic ../apptest2/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../Qt/5.2.0/gcc/mkspecs/linux-g++ -I../apptest2 -I../Qt/5.2.0/gcc/include -I../Qt/5.2.0/gcc/include/QtWidgets -I../Qt/5.2.0/gcc/include/QtGui -I../Qt/5.2.0/gcc/include/QtCore -I. -I. -I. -o main.o ../apptest2/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../Qt/5.2.0/gcc/mkspecs/linux-g++ -I../apptest2 -I../Qt/5.2.0/gcc/include -I../Qt/5.2.0/gcc/include/QtWidgets -I../Qt/5.2.0/gcc/include/QtGui -I../Qt/5.2.0/gcc/include/QtCore -I. -I. -I. -o mainwindow.o ../apptest2/mainwindow.cpp
    /home/paulcoder/Qt/5.2.0/gcc/bin/moc -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../Qt/5.2.0/gcc/mkspecs/linux-g++ -I../apptest2 -I../Qt/5.2.0/gcc/include -I../Qt/5.2.0/gcc/include/QtWidgets -I../Qt/5.2.0/gcc/include/QtGui -I../Qt/5.2.0/gcc/include/QtCore -I. -I. -I. ../apptest2/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../Qt/5.2.0/gcc/mkspecs/linux-g++ -I../apptest2 -I../Qt/5.2.0/gcc/include -I../Qt/5.2.0/gcc/include/QtWidgets -I../Qt/5.2.0/gcc/include/QtGui -I../Qt/5.2.0/gcc/include/QtCore -I. -I. -I. -o moc_mainwindow.o moc_mainwindow.cpp
    g++ -Wl,-rpath,/home/paulcoder/Qt/5.2.0/gcc -Wl,-rpath,/home/paulcoder/Qt/5.2.0/gcc/lib -o apptest2 main.o mainwindow.o moc_mainwindow.o -L/home/paulcoder/Qt/5.2.0/gcc/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: cannot find -lGL
    collect2: ld returned 1 exit status
    make: *** [apptest2] Error 1
    22:38:01: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project apptest2 (kit: Desktop Qt 5.2.0 GCC 32bit)
    When executing step 'Make'
    22:38:01: Elapsed time: 00:02.

    Using next Project Settings:

    qmake /home/paulcoder/apptest2/apptest2.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug

    Please point me out what is -lGL and how can I fix the linking and maybe to change/modify the linker / compiler flags.

    Thank you,

    http://swhweng.co.nr

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      I think "this post":http://qt-project.org/forums/viewthread/36866/ is of interest for you. I had detailed out today how to solve -lGL for Ubuntu 13.10. It should be the same for 12.04

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        swhweng
        wrote on last edited by
        #3

        Dear koahnig,

        Plenty thanks for your above correct and useful guidance response message.
        After pre-installation of several libs acc. to the post I have succ. to qmake, build and run Qt widgets and QML projects under Ubuntu 12.04 using Qt 5.2.0 only version, however, when I switch to Qt 5.1.1 - Qt 5.0.2 I get next error while building:

        Project EROR: addExclusiveBuilds() requires at least two arguments
        ...

        when executing qmake.

        Could somebody guide briefly why such error and how to resolve it while building ?

        Thanks in advance on any regards within this topic.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          Good to hear that your initial problem is solved.

          Are you using Qt creator when you switch Qt libs versions (e.g. to 5.1.1)?

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            swhweng
            wrote on last edited by
            #5

            When I switch the Qt versions ( e.g. from Qt 5.2.0 to Qt 5.1.1 down to Qt 5.0.2 ) I use the Qt Creator Projects tab when I have the sequence of the versions. I have checked also Build and Run -> Kits tab and found Qt 5.2.0 GCC 32 bit is detected as default. ( this is mainly not important details ).

            Please let me know why I get that "addExclusiveBuilds() requires at least two arguments" problem on Qt 5.0.2 - Qt 5.1.1 ?

            ...

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              I guess then that the other kits do not show any special icons under "Build&Run->Kits" and the same is true under "Qt Versions" and "Compilers".
              IIRC special icons are a yellow triangle with an exclamation mark and sometimes a red symbol.

              If all this is fine, I do not know where your problem could be.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • S Offline
                S Offline
                swhweng
                wrote on last edited by
                #7

                What does it mean: “addExclusiveBuilds() requires at least two arguments” ?

                I think next writeup may provide some clarity:

                "https://qt.gitorious.org/qt/qtbase/commit/c760d2dbfdaf743052be620f58c1f123420e9086":https://qt.gitorious.org/qt/qtbase/commit/c760d2dbfdaf743052be620f58c1f123420e9086

                May one guess that by setting some of the mentioned above variables ( environment or internal ) one can resolve the problem ? I didn't get yet what exact variables and to what values to set, please briefly guide how to resolve the mentioned problem.

                1 Reply Last reply
                0

                • Login

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