Terminal closing immediately

General questions regarding the usage of CodeLite
daMik3
CodeLite Curious
Posts: 5
Joined: Fri Aug 02, 2019 4:06 am
Genuine User: Yes
IDE Question: C++
Contact:

Terminal closing immediately

Post by daMik3 »

Hi!

I just got CodeLite latest version on my Windows laptop and when I build and run the default hello world program, the termainl closes immediately. The box "Pause when execution ends" under Project setting -> General, is checked, but the problem still exists. What can I do?

Thank you!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by eranif »

do you have anything in the output pane?
Make sure you have read the HOW TO POST thread
daMik3
CodeLite Curious
Posts: 5
Joined: Fri Aug 02, 2019 4:06 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by daMik3 »

It says
Working directory is set to: C:\Users\Mike\Documents\CodeLite_Workspaces\tet\pipis\Debug
Executing: cmd /C call C:\Users\Mike\Documents\CodeLite_Workspaces\tet\pipis\Debug\pipis.exe && pause
Program exited
Code is

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
	printf("hello world\n");
	return 0;
}
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by eranif »

What happens when you run this command from the command line?

Code: Select all

cmd /C call C:\Users\Mike\Documents\CodeLite_Workspaces\tet\pipis\Debug\pipis.exe && pause
Make sure that you execute it from:

Code: Select all

C:\Users\Mike\Documents\CodeLite_Workspaces\tet\pipis\Debug
Make sure you have read the HOW TO POST thread
daMik3
CodeLite Curious
Posts: 5
Joined: Fri Aug 02, 2019 4:06 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by daMik3 »

It gives me a System Error window that says:

"The code execution cannot proceed because libgcc_s_dw2-1.dll was not found. Reinstalling the program may fix this problem."
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by eranif »

This means that you need to the MinGW DLL (libgcc_s_dw2-1.dll ) to be copied into the PATH or better yet, copy it next to your executable
FYI: this has nothing to do with CodeLite, its just how MinGW works on Windows...
Make sure you have read the HOW TO POST thread
daMik3
CodeLite Curious
Posts: 5
Joined: Fri Aug 02, 2019 4:06 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by daMik3 »

It worked thank you! Will copying the dll file next to the executable get me into any problems when I execute my program on another computer?

Also, when I installed CodeLite it scanned for available compilers on my computer, it said it found none and then it redirected my to a sourceforge link to download MinGW. I downloaded and installed it but then it could still not find it on my pc when it scanned for available compilers. So i had to go to the MinGW page to get it.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by eranif »

Yes, you will need to copy this DLL when you install your program on other computers.
If CodeLite fails to locate your compiler, you should add it manually from:

Settings->Build Settings->Compilers and click on the green plus button
Make sure you have read the HOW TO POST thread
daMik3
CodeLite Curious
Posts: 5
Joined: Fri Aug 02, 2019 4:06 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by daMik3 »

Appreciate it, thank you!!!
ThangPham
CodeLite Curious
Posts: 1
Joined: Thu Aug 15, 2019 12:00 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Terminal closing immediately

Post by ThangPham »

I have a similar issue on my Codelite 13.0.0. My error message when I try to open it from File Explorer is "... libstdc++-6.dll is missing...". I copied it into the project folder but it doesn't help.

By the way, can you please instruct me on how to manage my templates. I saved the wrong template and also save the correct one into the "Console" instead of "Template".

Since I'm not good with computer or programming, your detailed instruction will be highly appreciated. But thank you all the same for your help.
Post Reply