views:

321

answers:

3

I have written the batch file below, in order to automate the process of launching Visual Studio 2008, and then building and compiling the solution file, so that instead of manually starting up VS2008 and then pressing F5, I can just run my solution file:

START CMD.EXE
cd C:\Program Files\MobileRobots\Aria\examples
mbuild myProg.sln

But it complains:

Select a compiler:
[1] Lcc C version 2.4.1 in C:\PROGRAM FILES\MATLAB\R2006A\sys\lcc
[0] None

What does this have anything to do with Matlab?!

It suggested I run:

mbuild -setup

But I didn't, as I didn't know what it had to do with Matlab. What is going on? How can I declare my VS2008 compiler? Why is it not detected automatically?

Thanks

A: 

You should be starting msbuild, not mbuild.

marklam
It wouldn't recognize msbuild. It says: 'msbuild' is not recognized as an internal or external command, operable program, or batch file.
HosseinJoshua MIRI
Try %WINDOWS%\Micrsoft.NET\Framework\v3.5\msbuild (if it's the 3.5 framework you're using)
marklam
+1  A: 

I think you're looking for msbuild.exe not mbuild.exe.

A Bunch
It wouldn't recognize msbuild. It says: 'msbuild' is not recognized as an internal or external command, operable program, or batch file.
HosseinJoshua MIRI
+1  A: 

mbuild is the matlab compiler...

msbuild is the Visual Studio build tool.

applechewer
Do you mean I should first do: msbuild -setup and then run my batch file? Because it wouldn't recognize msbuild. It says: 'msbuild' is not recognized as an internal or external command, operable program, or batch file.
HosseinJoshua MIRI
yes, you want to add msbuild.exe to your path or run it from its current location, on my machine it's at `C:\WINDOWS\Microsoft.NET\Framework\v3.5`.You can add it to your path (on Windows XP) by going to Control Panel -> System -> Advanced -> Environment Variables, then in the System Variables list, edit Path, add a semicolon to the end, and add the directory which msbuild.exe is in. Then you can just run msbuild from anywhere.
applechewer
Thanks applechewer. I simply copied msbuild.exe to the directory in which my batch file was located. Upon running my batch script, it built and compiled and launched VS2008. Now, how can I automate running the program as well (as opposed to pressing F5 when VS2008 is launched)? Thanks...
HosseinJoshua MIRI
Just run the compiled exe file in the batch script, it'll be in <project dir>\bin\Debug or similar.
applechewer