Reputation: 3
I'm trying to run a simple code with qt(using version 4.8) and I'm using visual studio express 2012. I've also added the qt include to the additional library in my visual studio. but yet cannot run the program. This is the code :
#include <Qt\application.h>
int main(int argc, char* argv[])
{
QApplication app(int argc, char* argv);
return app.exec();
}
I read that people say that, there must be a change in the .pro file in order to make to program run correctly, so I figured to paste my .pro file so you can get extra information about it.
CONFIG += console bootstrap
CONFIG -= qt shared app_bundle uic
DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED
DESTDIR = ../bin/
OBJECTS_DIR = .
MOC_DIR = .
#guts
VPATH += $$QT_SOURCE_TREE/src/corelib/global \
$$QT_SOURCE_TREE/src/corelib/tools \
$$QT_SOURCE_TREE/src/corelib/kernel \
$$QT_SOURCE_TREE/src/corelib/codecs \
$$QT_SOURCE_TREE/src/corelib/plugin \
$$QT_SOURCE_TREE/src/corelib/xml \
$$QT_SOURCE_TREE/src/corelib/io
INCLUDEPATH += . \
generators \
generators/unix \
generators/win32 \
generators/mac \
generators/symbian \
generators/integrity \
$$QT_SOURCE_TREE/include \
$$QT_SOURCE_TREE/include/QtCore \
$$QT_SOURCE_TREE/qmake
VPATH += $$QT_SOURCE_TREE/tools/shared
INCLUDEPATH += $$QT_SOURCE_TREE/tools/shared
include(qmake.pri)
Upvotes: 0
Views: 1105
Reputation: 10827
Although there is a Qt3Support
module that you can enable in your .pro
to allow you to use some of the deprecated classes from Qt3
you need to use #include <QApplication>
instead of #include <Qt\application.h>
with Qt4
or Qt5
.
Upvotes: 1