Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I made a program by using Qt Creator in Qt 4.x on an Ubuntu Linux platform in the last year. Now I don't use linux, instead I use Windows 7. I once again need my program which I made last year. I downloaded and installed Qt Creator onto Windows 7 platform. It came with Qt 5.1. I try to rebuilt it. I got below messages. What should I do?

C1083: Cannot open include file: 'QtGui/QApplication': No such file or directory
C1083: Cannot open include file: 'QDialog': No such file or directory

Thanks

share|improve this question
1  
<QtGui/QApplication> is now just <QApplication>. – Markus Meskanen Jul 13 '13 at 8:39

In Qt5 QApplication is no longer part of QtGui module, it's now in QtWidgets. In your #include directive use <QtWidgets/QApplication>, the same applies to QDialog.

share|improve this answer

Use this in your .pro file.

QT += ...
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

The Qt modules have been rearranged somewhat in Qt5. Also this will teach for leaving Linux!

share|improve this answer
    
I added like this QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = MVMO_01 it still gives the same errors. May it be related to "INCLUDEPATH" or "DEPENDPATH"? – adba Jul 13 '13 at 7:20
    
You don't need the INCLUDEPATH for Qt's own stuff, as Qt should know where they are already. In Qt Creator you can view the Qt Versions available and see where it thinks the headers are (under QT_INSTALL_HEADERS). – cmannett85 Jul 13 '13 at 7:31
    
Where is the QT_INSTALL_HEADERS tag? – adba Jul 13 '13 at 7:53
    
Go to Tools->Options, then Build & Run->Qt Versions tab. Click on your Qt version and expand it's details. – cmannett85 Jul 13 '13 at 8:12
2  
You should run qmake after you modify the .pro file and only after that try to build your application. – Zlatomir Jul 13 '13 at 9:21

There's a good guide on what has changed from QT 4.x to 5.x http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.