user1824407
user1824407

Reputation: 4579

C++ command line compiler for Visual Studio 2012

I have installed Visual Studio Express 2012 and I have added cl.exe to my PATH but apparently is missing a dll ( ? ), the mspdb110.dll, I have also noticed that there are 2 cl.exe in 2 different paths:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64

how i can compile a file main.cpp from the command line with the VS compiler ? Where I can find a reference for this compiler ?

Thanks.

Upvotes: 13

Views: 21396

Answers (1)

James McNellis
James McNellis

Reputation: 355327

Run the vcvarsall.bat batch file from the VC directory under whatever directory you installed Visual Studio to (e.g., on my PC, it's in C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC). This batch file will configure the environment for toolchain use.

By default, it will configure the environment for use of the x86 native toolchain. You can also provide an argument to the batch file to use a different toolchain. For example, you can pass amd64 to use the native x64 toolchain, or x86_amd64 to use the x86 -> x64 cross compilation toolchain. Take a look at the contents of the batch file if you are interested in other options or what, exactly, it configures.

Upvotes: 16

Related Questions