Page 1 of 1
CMD closes instantly after executing and creating Hello.exe
Posted: Tue Apr 22, 2014 7:08 pm
by RomanK
Hi everyone,
Just recently I've been teaching myself C Programming. When I create a source code (EX. Hello.c), compile the source code, and then execute the .exe file, I have an issue with the CMD. The CMD is able to execute the .exe, but it only executes the source code "Hello, World!" for about 1/10 of a second, then the CMD shuts down instantly.
Any ideas on how to fix this so that the CMD shuts down from an input of any button after the file is executed?
Thank you!!
Re: CMD closes instantly after executing and creating Hello.
Posted: Tue Apr 22, 2014 7:23 pm
by eranif
right click on the project -> settings -> common settings -> general
at the bottom of the page there is a check box: "pause when execution terminates" - tick it
Eran
Re: CMD closes instantly after executing and creating Hello.
Posted: Tue Apr 22, 2014 7:36 pm
by RomanK
eranif wrote:right click on the project -> settings -> common settings -> general
at the bottom of the page there is a check box: "pause when execution terminates" - tick it
Eran
I tried, still closes instantly. I tried using a a different IDE as well (Code::Blocks) and it does the same thing
Re: CMD closes instantly after executing and creating Hello.
Posted: Tue Apr 22, 2014 7:45 pm
by eranif
Please post some more information:
- The build log
- The content of the 'Trace' tab
- Can you run it from the command line?
Eran
Re: CMD closes instantly after executing and creating Hello.
Posted: Fri Apr 25, 2014 11:02 am
by armin
i hav this problem too, pause when execution terminates has tick,
http://s1.bild.me/bilder/260513/9467378problem.jpg
my build is:
Code: Select all
C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 8 -e -f Makefile"
"----------Building project:[ jet - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/A/Documents/CodeLite_job/work/jet'
mingw32-make.exe[1]: Leaving directory 'C:/Users/A/Documents/CodeLite_job/work/jet'
mingw32-make.exe[1]: Entering directory 'C:/Users/A/Documents/CodeLite_job/work/jet'
g++ -c "C:/Users/A/Documents/CodeLite_job/work/jet/a1.cpp" -g -O0 -Wall -std=c++11 -o ./Debug/a1.o -I. -I.
g++ -o ./Debug/jet @"jet.txt" -L.
mingw32-make.exe[1]: Leaving directory 'C:/Users/A/Documents/CodeLite_job/work/jet'
0 errors, 0 warnings
my trace is:
Code: Select all
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\config\accelerators.conf.default'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\abbreviation.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\cscope.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\external_tools.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\phplite.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\unittestpp.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite/config/accelerators.conf.default'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\abbreviation.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\cscope.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\external_tools.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\phplite.accelerators'
11:38:45: Loading accelerators from 'C:\Program Files (x86)\CodeLite\plugins\resources\unittestpp.accelerators'
11:38:45: Initializing refactoring database for workspace: work
11:38:45: Initializing refactoring database for workspace: work... done
11:38:45: Info: codelite is up-to-date (or newer), version used: 5.4, version on site: 5.4
11:38:45: Symbols file loaded into OS file system cache (0 seconds)
11:38:56: Error: Can't load bitmap 'question_and_answer' from resources! Check .rc file.
11:38:57: 0 needed to be parsed. Stored 0 new tags to the database
11:38:57: INFO: Retag workspace completed in 0 seconds (No files were retagged)
11:38:59: Error: Failed to kill process 7240 (error 0: the operation completed successfully.)
11:38:59: 0 needed to be parsed. Stored 0 new tags to the database
11:38:59: INFO: Retag workspace completed in 0 seconds (No files were retagged)
Re: CMD closes instantly after executing and creating Hello.
Posted: Fri Apr 25, 2014 11:40 am
by eranif
You are not executing it, you are 'debugging' it
The Green play button is for starting the debugger.
To execute it click on the cog icon with the orange arrow, or use Ctrl-F5
You can also place a breakpoint in your code, by simply left clicking on the left margin and when you hit the green play button (or F5) codelite will start the debugger and will stop there
Eran
Re: CMD closes instantly after executing and creating Hello.
Posted: Sat Apr 26, 2014 8:46 pm
by armin
OH MY GOD
!!! thank you ERANIF
ctrl-f5