Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Which code I must return?
I have the simple program.
But, after end of program I have message "During startup program exited with code 0x0".
The program code is following:
int main(int argc, char *argv)
std::cout << "Hello!";
@QT += core
QT -= gui
TARGET = test2
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp@
Which code I need returning that there is no error?
Welcome to this forum.
In principle you may return any code you like. However, 0 is typically used to indicate that there has been no error encountered. The message you are seeing is a standard information message telling you the return code. It is not an error message and everything is fine.
But it looks how an error message.
Are there any way to avoid this message?
You are right this looks like an error message. When I read your return code message, I thought it is the standard message you see for some console programs.
Which operation system are using?
Operation system is Windows7 (Processor amd64)
Information from "About Qt Creator"
Qt Creator 2.3.0 (based on Qt 4.7.4)
build Aug 25 2011 in 15:26:28
That is the output see under Linux built with qt creator
Hello World !
./helloWorld-build-desktop/helloWorld exited with code 0 @
I have tried it also under windows 7 with msvc2005 for a console application you will see only
Hello World !
I do not have qt creator installed on windows for cross check.
The phrase "During start-up " puzzles me a little. I did not see immendiately, but together with the screen shot you have posted, it looks really strange.
When you change the return to a different value, does it output this new value?
The message just states the error code that your code returned. There was no error (otherwise it would say so in the message).
If we would not give that message in Qt Creator then you had little chance to debug error cases where your application just exists with some error code. This message will not show up when running this application outside Qt Creator.
- to koahnig:
bq. When you change the return to a different value, does it output this new value?
Yes, when I return a diffrent values, it show me respective values.
- to Tobias Hunger:
bq. There was no error (otherwise it would say so in the message).
Oh, okay... Simply, I been puzzled the image of the red circle with the white cross.
Problem resolved, thanks!