Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

QApplication: No such file or directory of Qt Classic error message

Shulou Source: shulou.com Published: 2022-06-03 06:36:08 09月23日 Update

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.

Tags: Compilation information novice step directory classic depressed one line code example that is mind file method time according to version result error problem Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology vpn Redmi macOS Shulou Information