views:

1383

answers:

4

What is the name of the Command Line Compiler for a C/C++ program that target's Windows Mobile?

I have Visual Studio 2008 Professional installed and I need to be able to compile a program from the command line. I've checked the project properties in Visual Studio and it shows me all of the parameters that are being passed to the compiler, but it doesn't show the name of the compiler itself.

+3  A: 

The name of the command line C++ compiler is cl.exe

The executable for windows ce is usually located at

%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm\cl.exe

x86_arm can be replaced with x86_mips or x86_sh depending on the particular architecture.

Here's some further information on the Windows CE / Mobile Command Line Compiler: http://msdn.microsoft.com/en-us/library/aa448630.aspx

JaredPar
+2  A: 

JaredPar has the answer about the actual location for cl.exe, but depending on what you need to do, you might want to look into invoking devenv from the command line -

Microsoft (R) Visual Studio Version 9.0.21022.8.
Copyright (C) Microsoft Corp. All rights reserved.

Use:
devenv  [solutionfile | projectfile | anyfile.ext]  [switches]

The first argument for devenv is usually a solution file or project file.
You can also use any other file as the first argument if you want to have the
file open automatically in an editor. When you enter a project file, the IDE
looks for an .sln file with the same base name as the project file in the
parent directory for the project file. If no such .sln file exists, then the
IDE looks for a single .sln file that references the project. If no such single
.sln file exists, then the IDE creates an unsaved solution with a default .sln
file name that has the same base name as the project file.

Command line builds:
devenv solutionfile.sln /build [ solutionconfig ] [ /project projectnameorfile [     /projectconfig name ] ]

etc...

The potential advantage that this gets you is that you can drive the compile from the command line, but it'll use the settings defined in the project/solution. That way you don't have to keep a makefile in sync with changes that are made to the project in the IDE.

Michael Burr
Thanks a lot, that's useful information!
Joel
+1  A: 

MSBuild also works well.

Sample command doing a full rebuild. Your arguments may vary.

C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe  /t:Rebuild /p:Configuration="Release";Platform="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"; /v:normal /m "C:\MySolutions\MySolution.sln"
JDM
A: 

From within Visual Studio, open the Tools/Options/"Projects and Solutions"/"VC++ Directories" dialog, select the appropriate values from the Platform dropdown (e.g. "Windows Mobile 6 Professional SDK (ARMV4I)"). Now toggle through the various values in the "Show directories for" dropdown (e.g. "Executable Files", "Include Files", "Reference Files", "Library Files") and make a note of the directories that appear in each list. These are the directories needed by the command line tools.

You can then create a batch file that sets up a command line environment for Windows Mobile development:

SET PATH=[Executable Files separated by semicolons]
SET INCLUDE=[Include Files separated by semicolons]
SET LIBPATH=[Reference Files separated by semicolons]
SET LIB=[Library Files separated by semicolons]
Greg Menounos