Reputation: 48966
I have done the following to run a simple Qt
program:
hello
folderhello.cpp
program as follows:#include <QApplication> #include <QLabel> int main(int argc, char* argv[]) { QApplication app(argc, argv); QLabel *label = new QLabel("Hello..."); label->show(); return app.exec(); }
qmake -project
qmake hello.pro
---> Here I get Makefile
c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello make -f Makefile.hello make[1]: Entering directory
/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello make -f Makefile.hello.hello make[2]: Entering directory
/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello make -f Makefile.hello.hello.hello make[3]: Entering directory/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello make[4]: Entering directory
/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello.hello make[5]: Entering directory/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello.hello.hello make[6]: Entering directory
/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello.hello.hello.hello make[6]: * [sub-hello-pro-make_default] Interrupt make[5]: * [sub-hello-pro-make_default] Interrupt make[4]: * [sub-hello-pro-make_default] Interrupt make[3]: * [sub-hello-pro-make_default] Interrupt make[2]: * [sub-hello-pro-make_default] Interrupt make[1]: * [sub-hello-pro-make_default] Interrupt make: * [sub-hello-pro-make_default] Interrupt
How can I run the program?
Thanks.
Upvotes: 1
Views: 136
Reputation: 31
Use the Qt Command Prompt installed with Qt installation package. Then, instead of using make
, use mingw32-make
.
It works for me.
Upvotes: 3