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. Qt5 cannot find header files - OpenSuse
Forum Updated to NodeBB v4.3 + New Features

Qt5 cannot find header files - OpenSuse

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 3.4k 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.
  • J Offline
    J Offline
    jrfaria
    wrote on 19 Feb 2013, 13:33 last edited by
    #1

    This may be a regular question but so far I couldn't find an answer.

    The following error appears when trying to compile:

    g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../qtbase/mkspecs/linux-g++-64 -I. -I. -I../qtbase/include -I../qtbase/include/QtGui -I../qtbase/include/QtCore -I. -o a.o a.cpp
    a.cpp:1:24: fatal error: QApplication: No such file or directory

    This happens when I run with qmake -project --> qmake --> make. As well as from c++ directly:

    fatal error: QApplication: No such file or directory

    It cannot find any header, although they are all there in ../qtbase/include/ . It seems something with the configure, i.e., before the compilation, which by the way ran without errors.

    The code I ran is the first in http://doc.qt.digia.com/4.7/gettingstartedqt.html#creating-a-pro-file

    I appreciate any help.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fidbc
      wrote on 23 Mar 2013, 16:11 last edited by
      #2

      Hi jrfaria,

      Ran into the same problem. I think I've figured this out now. This solution is based on this "post":http://qt-project.org/forums/viewthread/23009 .

      Apparently in Qt5 qtwidgets is a module which is apart from qtgui (in contrast to qt4). Therefore adding

      @QT += widgets@

      to your .pro file should do the job (it seems qmake is the culprit).

      So to compile you would do something like

      qmake -project -> (if needed, add "QT += widgets" to the .pro file) -> qmake -> make.

      I've tried this on a couple of the qt examples and it has worked.

      Hope it helps.

      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