QApplication: No such file or directory of Qt Classic error message
QApplication: No such file or directory of Qt Classic error message
This error message is usually the first example for a novice to open Qt programming when compiling Qt5's first application "Hello,World". All
It's easy to say.
# include
# include
Int main (int argc, char * argv [])
{
QApplication app (argc,argv)
QWidget * ww=new QWidget ()
Ww- > resize (300200)
Ww- > show ()
Return app.exec ()
}
A compilation result of the above error, which is called a depressed.
As a matter of fact, a novice can solve the problem on his own by paying attention to the hint. The method is also simple, that is, after performing the following two steps
Qmake-project
Qmake
Modify the hello.pro project file immediately and add a line of code as follows:
QT + = gui declarative or QT + = core gui widgets
After saving it, perform the last step: mingw32-make.exe
In this way, you can compile a distribution version of hello.exe in the release directory, note, not the debug directory.