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. Compile/Running in terminal and keep getting same error - Ubuntu 14.04
Forum Updated to NodeBB v4.3 + New Features

Compile/Running in terminal and keep getting same error - Ubuntu 14.04

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 863 Views 2 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
    samapollo
    wrote on 24 Jun 2016, 14:26 last edited by samapollo
    #1

    Hey guys,
    I keep trying to compile in Terminal but am running into the same error. It says that <QGLWidget> doesnt exist. I have added QtOpenGl to my header, as well as my main.cpp. I have added the proper command to the .pro file, and added an INCLUDEPATH to the actual qt project itself. But I still end up with the exact same error. Below is my command in Terminal, and then its response:

    sam@sam-VirtualBox:~/Downloads$ "/home/sam/Downloads/qt-everywhere-opensource-src-4.8.5/bin/qmake" '/home/sam/Qt5.0.2/5.0.2/gcc/examples/opengl/2dpainting/2dpainting.pro' -r CONFIG+=debug -spec /home/sam/Downloads/qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-arm-gnueabi-g++
    sam@sam-VirtualBox:~/Downloads$ make
    /home/sam/Downloads/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -Iqt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-arm-gnueabi-g++ -I../Qt5.0.2/5.0.2/gcc/examples/opengl/2dpainting -I/usr/local/Qt-4.8.5-arm/include/QtCore -I/usr/local/Qt-4.8.5-arm/include/QtNetwork -I/usr/local/Qt-4.8.5-arm/include/QtGui -I/usr/local/Qt-4.8.5-arm/include/QtOpenGL -I/usr/local/Qt-4.8.5-arm/include -I/home/sam/downloads/qt-everywhere-opensource-src-4.8.5/include/QtOpenGL -I. -I../Qt5.0.2/5.0.2/gcc/examples/opengl/2dpainting -I. -o glwidget.o ../Qt5.0.2/5.0.2/gcc/examples/opengl/2dpainting/glwidget.cpp
    In file included from ../Qt5.0.2/5.0.2/gcc/examples/opengl/2dpainting/glwidget.cpp:41:0:
    ../Qt5.0.2/5.0.2/gcc/examples/opengl/2dpainting/glwidget.h:44:21: fatal error: QGLWidget: No such file or directory
    #include <QGLWidget>
    ^
    compilation terminated.
    make: *** [glwidget.o] Error 1

    Really appreciate any comments/help!!!

    Cheers

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Joel Bodenmann
      wrote on 24 Jun 2016, 14:30 last edited by Joel Bodenmann
      #2

      Is it possible that you forgot to add the OpenGL module in your *.pro file?

      QT += opengl
      

      Edit: You stated that you "added the proper command to the *.pro file". Looking at the documentation it seems like that was only added for Qt 5 while judging from your output you are using Qt 4.8:

      • Qt5
      • Qt4.8

      Industrial process automation software: https://simulton.com
      Embedded Graphics & GUI library: https://ugfx.io

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 24 Jun 2016, 21:29 last edited by
        #3

        Hi,

        To add to @Joel-Bodenmann, watch out, you are trying to build Qt 5 examples with Qt 4. Not that it's not possible but you may have surprises.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1

        1/3

        24 Jun 2016, 14:26

        • 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