My First Project Simple Hello World and it doen't run...
-
Hello All,
I am a complete newbie and started creating my first QT Console app with below code
#include <QCoreApplication> #include <iostream> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); std::cout << "Hello World!"; return a.exec(); }
It compiles and when running it looks like it is stuck here
Starting C:\QT_Projects\build-HelloWorld-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\HelloWorld.exe ...
I am not seeing any console with Hellow World...
The Kit selected is default one "Desktop QT 5.15.1 MinGW 64-bit"
Any help will be deeply appreciated.
-
Hello All,
I am a complete newbie and started creating my first QT Console app with below code
#include <QCoreApplication> #include <iostream> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); std::cout << "Hello World!"; return a.exec(); }
It compiles and when running it looks like it is stuck here
Starting C:\QT_Projects\build-HelloWorld-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\HelloWorld.exe ...
I am not seeing any console with Hellow World...
The Kit selected is default one "Desktop QT 5.15.1 MinGW 64-bit"
Any help will be deeply appreciated.
I am not seeing any console with Hellow World...
If you start this from QtCreator the output will probably redirected to there.
Go to "Projects" -> Build & Run -> Run -> set a checkbox in "Run in terminal/commandpropt"
-
Hello All,
I am a complete newbie and started creating my first QT Console app with below code
#include <QCoreApplication> #include <iostream> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); std::cout << "Hello World!"; return a.exec(); }
It compiles and when running it looks like it is stuck here
Starting C:\QT_Projects\build-HelloWorld-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\HelloWorld.exe ...
I am not seeing any console with Hellow World...
The Kit selected is default one "Desktop QT 5.15.1 MinGW 64-bit"
Any help will be deeply appreciated.
@HK__ said in My First Project Simple Hello World and it doen't run...:
It compiles and when running it looks like it is stuck here
It's not stuck, add << std::endl after "Hello World!" string.
Explanation: stdout is buffered, a.exec() call is blocking, you need to force stdout to print out your string, one way to do so is to add std::endl (newline).For debug output you can also use qDebug() << instead of std::cout <<
-
Hello All,
I am a complete newbie and started creating my first QT Console app with below code
#include <QCoreApplication> #include <iostream> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); std::cout << "Hello World!"; return a.exec(); }
It compiles and when running it looks like it is stuck here
Starting C:\QT_Projects\build-HelloWorld-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\HelloWorld.exe ...
I am not seeing any console with Hellow World...
The Kit selected is default one "Desktop QT 5.15.1 MinGW 64-bit"
Any help will be deeply appreciated.
I am not seeing any console with Hellow World...
If you start this from QtCreator the output will probably redirected to there.
Go to "Projects" -> Build & Run -> Run -> set a checkbox in "Run in terminal/commandpropt"
-
I am not seeing any console with Hellow World...
If you start this from QtCreator the output will probably redirected to there.
Go to "Projects" -> Build & Run -> Run -> set a checkbox in "Run in terminal/commandpropt"