Page 1 of 1

Problem of cl.exe when using in makefile

Posted: Tue Dec 06, 2011 7:31 am
by fanhe0513
As well know, we must run vsvars32.bat before using cl.exe in cmd.exe, but this can not be done in makefile.
So currently cl.exe can not be ran in makefile, even if I make a target which running vsvars32.bat firstly.

This will work, puts vsvars32.bat in xxx_wsp.mk, for example:

Code: Select all

all:
	@echo ----------Building project:[ abc - Debug ]----------
	@"D:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" && cd "abc" && "$(MAKE)" -f "abc.mk"
Are there any other better ways?

Windows XP SP3, visual studio 2010, mingw-4.4.1

Thanks.

Re: Problem of cl.exe when using in makefile

Posted: Tue Dec 06, 2011 7:35 am
by foxmuldr
Try running vcvars32.bat in a command window first, and then launching Codelite from within the same command window, as I believe the spawned processes will inherit the modified environment state.