Need Help with executing first program in Code Lite

CodeLite installation/troubleshooting forum
aeroaks
CodeLite Curious
Posts: 5
Joined: Mon Jul 30, 2012 8:57 am
Genuine User: Yes
IDE Question: C++
Contact:

Need Help with executing first program in Code Lite

Post by aeroaks »

I had installed codelite-4.0.5589-mingw4.6.1-wx2.9.4.exe (from http://sourceforge.net/projects/codelit ... elite-4.0/) which installed codelite, mingw and wx.
I then tried to do the same as in this LINK: http://www.codelite.org/docs/VideoTutor ... nsole.html.

I am not getting "Hello World" printed in my Console. I have posted the build log below. Could you please help.

Code: Select all

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "workspace_wsp.mk""
mingw32-make.exe: Do not specify -j or --jobs if sh.exe is not available.
mingw32-make.exe: Resetting make for single job mode.
----------Building project:[ wxWidgetTest - Release ]----------
mingw32-make.exe[1]: Do not specify -j or --jobs if sh.exe is not available.
mingw32-make.exe[1]: Resetting make for single job mode.
mingw32-make.exe[1]: Entering directory `D:/workspace/wxWidgetTest'
g++ -o ./Release/wxWidgetTest @"D:\workspace\wxWidgetTest\wxWidgetTest.txt" -L.   -s  -mthreads -LC:\wxWidgets-2.9.4\lib\gcc_dll -lwxmsw29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32  -mwindows
g++: @D:\workspace\wxWidgetTest\wxWidgetTest.txt: Invalid argument
mingw32-make.exe[1]: *** [Release/wxWidgetTest] Error 1
mingw32-make.exe: *** [All] Error 2
mingw32-make.exe[1]: Leaving directory `D:/workspace/wxWidgetTest'
----------Build Ended----------
0 errors, 0 warnings
Do let me know if I did forget any detail.
aeroaks
CodeLite Curious
Posts: 5
Joined: Mon Jul 30, 2012 8:57 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Need Help with executing first program in Code Lite

Post by aeroaks »

I have tried Writing a simple hello world program (http://www.codelite.org/LiteEditor/HelloWorld). But getting similar Errors.

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
	printf("hello world\n");
	return 0;
}
----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe" -j 2 -f "workspace_wsp.mk""
mingw32-make.exe: Do not specify -j or --jobs if sh.exe is not available.
mingw32-make.exe: Resetting make for single job mode.
----------Building project:[ HelloWorld - Release ]----------
mingw32-make.exe[1]: Do not specify -j or --jobs if sh.exe is not available.
mingw32-make.exe[1]: Resetting make for single job mode.
mingw32-make.exe[1]: Entering directory `D:/workspace/HelloWorld'
mingw32-make.exe[1]: Leaving directory `D:/workspace/HelloWorld'
mingw32-make.exe[1]: Do not specify -j or --jobs if sh.exe is not available.
mingw32-make.exe[1]: Resetting make for single job mode.
mingw32-make.exe[1]: Entering directory `D:/workspace/HelloWorld'
g++ -c "D:/workspace/HelloWorld/main.cpp" -O2 -Wall -o ./Release/main.o -I. -I.
g++ -o ./Release/HelloWorld @"D:\workspace\HelloWorld\HelloWorld.txt" -L.
g++: @D:\workspace\HelloWorld\HelloWorld.txt: Invalid argument
g++: no input files
mingw32-make.exe[1]: *** [Release/HelloWorld] Error 1
mingw32-make.exe[1]: Leaving directory `D:/workspace/HelloWorld'
mingw32-make.exe: *** [All] Error 2
----------Build Ended----------
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Need Help with executing first program in Code Lite

Post by eranif »

You got another installation on your system which includes mingw toolchain and it seems that it takes precedence of codelite's MinGW installation.
Remove it from your path OR make sure that codelite's mingw is the first one in the PATH environment variable.

Eran
Make sure you have read the HOW TO POST thread
aeroaks
CodeLite Curious
Posts: 5
Joined: Mon Jul 30, 2012 8:57 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Need Help with executing first program in Code Lite

Post by aeroaks »

Thanks. DId remove previous Installation of MinGw and the Hello World code runs successfully.

But Regarding the first Post:

The code builds Successfully, similar to the Hello World program, but when I try to RUN the code the Output of the program is not visible. When I try to run the .exe under the release folder of the project, it says that "The program cannot start because wxmsw294u_gcc_custom.dll is missing". What should be done?
eranif wrote:You got another installation on your system which includes mingw toolchain and it seems that it takes precedence of codelite's MinGW installation.
Remove it from your path OR make sure that codelite's mingw is the first one in the PATH environment variable.

Eran
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Need Help with executing first program in Code Lite

Post by eranif »

It means that you modified the default PATH environment within codelite.
Please paste here the content of:
Settings -> Environment variables

Eran
Make sure you have read the HOW TO POST thread
aeroaks
CodeLite Curious
Posts: 5
Joined: Mon Jul 30, 2012 8:57 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Need Help with executing first program in Code Lite

Post by aeroaks »

CodeLiteDir=C:\Program Files\CodeLite
WXWIN=C:\wxWidgets-2.9.4
PATH=$(WXWIN)\lib\gcc_dll;$(PATH)
WXCFG=gcc_dll\mswu
UNIT_TEST_PP_SRC_DIR=C:\UnitTest++-1.3
These are all the settings! Hope it helps.

I really appreciate your time and help!

eranif wrote:It means that you modified the default PATH environment within codelite.
Please paste here the content of:
Settings -> Environment variables

Eran
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Need Help with executing first program in Code Lite

Post by eranif »

aeroaks wrote:The code builds Successfully, similar to the Hello World program, but when I try to RUN the code the Output of the program is not visible
I missed that line.
Quick question: which project type did you choose?

If you selected wxWidgets project and you want to view the output in the console, then make sure that you remove the flag -mwindows from the linker option (right click on your project -> settings -> linker -> Options)
rebuild your project from within codelite and execute it - you should now see the black CMD console.
eranif wrote:it says that "The program cannot start because wxmsw294u_gcc_custom.dll is missing".
when running programs from within codelite, codelite modifies the environment variable a bit to allow executing wxWidgets related programs, for example it adds the path where the wxWidgets dlls exists:

Code: Select all

WXWIN=C:\wxWidgets-2.9.4
PATH=$(WXWIN)\lib\gcc_dll;$(PATH)
In the above, codelite will prepend the "C:\wxWidgets-2.9.4\lib\gcc_dll" to the content of the environment variable $(PATH), ofc this change only affects when executing from within codelite and not from the console.

Eran
Make sure you have read the HOW TO POST thread
aeroaks
CodeLite Curious
Posts: 5
Joined: Mon Jul 30, 2012 8:57 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Need Help with executing first program in Code Lite

Post by aeroaks »

removed the -mwindows flag from the linker and the output is visible in the console.
Thanks.

What settings do I need to do to get a executable file for console / GUI output.
Post Reply