Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 555
user1824407 Avatar asked Nov 17 '12 07:11

user1824407


Video Answer


1 Answers

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.

like image 103
James McNellis Avatar answered Oct 23 '22 18:10

James McNellis