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. C++ / compilation of a program fatal error: QtGui/qwidget.h: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

C++ / compilation of a program fatal error: QtGui/qwidget.h: No such file or directory

Scheduled Pinned Locked Moved General and Desktop
c++compilationqmakeqt4
2 Posts 1 Posters 4.9k 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.
  • L Offline
    L Offline
    lilouch
    wrote on 11 Jun 2015, 06:28 last edited by lilouch 6 Nov 2015, 09:30
    #1

    hi,

    I've downloaded a linux application which required qt4.
    I have it already on my computer.

    I have this following error when I want to compile the program using make

    In file included from /usr/include/qt4/QtGui/QMainWindow:1:0,
                 from /home/Desktop/plane/src/planeviewer.h:3,
                 from /home/Desktop/plane/src/moc_planeviewer.cxx:9:
    /usr/include/qt4/QtGui/qmainwindow.h:45:27: fatal error: QtGui/qwidget.h: No such file or directory
     #include <QtGui/qwidget.h>
                               ^
    compilation terminated.
    make[2]: *** [CMakeFiles/util_convert.dir/moc_planviewer.cxx.o] Error 1
    make[1]: *** [CMakeFiles/util_convert.dir/all] Error 2
    make: *** [all] Error 2
    

    I don't understand because I checked already everything.
    I have the following input for those different commands line:

    qmake --version

    QMake version 2.01a
    Using Qt version 4.8.6 in /usr/lib/x86_64-linux-gnu
    

    locate qwidget.h

    /opt/qt/5.4/android_armv7/include/QtWidgets/qwidget.h
    /opt/qt/5.4/gcc_64/include/QtWidgets/qwidget.h
    /usr/include/qt4/Qt/qwidget.h
    /usr/include/qt4/QtGui/qwidget.h
    

    So the file already exists.

    The CmakeList in case

    find_package(Boost 1.58 REQUIRED COMPONENTS serialization program_options python)
    find_package(PythonLibs 2.6 REQUIRED)
    
    set(QT_USE_QTSVG TRUE)
    set(QT_USE_QTXML TRUE)
    set(QT_USE_QTOPENGL TRUE)
    find_package(OpenGL)
    find_package( Qt4 REQUIRED )
    
    INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}")
    INCLUDE_DIRECTORIES("${PYTHON_INCLUDE_PATH}")
    INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTSVG_INCLUDE_DIR}
                        ${QT_QTXML_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIRS})
    
    QT4_WRAP_UI(util_convert_FORMS planeviewer.ui)
    QT4_WRAP_CPP(util_convert_MOCS planeviewer.h planewidget.h)
    ADD_EXECUTABLE(util_convert ${util_convert_FORMS} ${util_convert_MOCS} plane.cpp util_convert.cpp planeviewer.cpp planewidget.cpp objects.cpp coordinates.cpp utils.cpp)
    TARGET_LINK_LIBRARIES(util_convert ${Boost_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTSVG_LIBRARY}
                                      ${QT_QTXML_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES})
    

    Before posting this, I already searched on the internet but didn't find a solution yet.

    Can someone helps me ?

    Thanks

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lilouch
      wrote on 11 Jun 2015, 09:30 last edited by
      #2

      Okey I finally soved it bu adding this line to the CMakeList
      INCLUDE_DIRECTORIES("/usr/include/qt4/")

      I don't know why the authors didn't put this line into the CmakeList.

      1 Reply Last reply
      0

      1/2

      11 Jun 2015, 06:28

      • Login

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