User forums > Help

Program runs in codeblocks but not from the executable.

(1/1)

Midnite:
Hello
So I just started learning c++ and I tried to create a simple hello world program, it builds and runs just fine in code blocks, running it from cmd seems to be working aswell but when I doubleclick the .exe it just quickly flashes an empty window on the screen. I realize this question has been asked before but I wasn't able to find a solution in any of the old threads.

 

stahta01:

--- Quote from: Midnite on September 16, 2017, 11:39:10 pm ---Hello
So I just started learning c++ and I tried to create a simple hello world program, it builds and runs just fine in code blocks, running it from cmd seems to be working aswell but when I doubleclick the .exe it just quickly flashes an empty window on the screen. I realize this question has been asked before but I wasn't able to find a solution in any of the old threads.

--- End quote ---

This is likely because that is how you wrote your program.
You need to ask on a site that teaches programming.
Link to this site rules: http://forums.codeblocks.org/index.php/topic,9996.0.html

Tim S.

BlueHazzard:
because this is quite common, i added a FAQ entry in the wiki:
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_My_program_runs_in_codeblocks_but_if_i_start_it_from_the_outside_it_only_flashes_and_closes_immediately

Midnite:
Right, sorry for asking stupid questions, I didn't want to move forward until I was sure I didn't fuck up some compiler settings or something.
Thank you


--- Quote from: stahta01 on September 17, 2017, 12:20:40 am ---You need to ask on a site that teaches programming.
Link to this site rules: http://forums.codeblocks.org/index.php/topic,9996.0.html

Tim S.

--- End quote ---
Gotcha, wrong place.

Navigation

[0] Message Index

Go to full version