13

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.

1
  • +1 for doing it the right way.
    – user529758
    Nov 17, 2012 at 7:20

1 Answer 1

16

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.

8
  • thanks, i should start to power-off my brain before using Windows, ... I would be curious to know what is the point of doing a second setup after the first one and making things so complicated ... anyway, this works. Nov 17, 2012 at 7:27
  • 1
    What are the first and second steps and which one is complicated? Nov 17, 2012 at 7:28
  • I should indicate that vcvarsall.bat is the only good way to use it. I have 3 major visual studio versions(2008 for python,2010 for CUDA,2012 for common purpose) installed. Without vcvarsall.bat files, I were completely doomed because of configuration (PATH etc.) changes. Nov 17, 2012 at 7:35
  • under linux you install a compiler/IDE, you get a working compiler, under Windows i have installed Visual Studio 2012 i didn't get a working compiler. Nov 17, 2012 at 7:36
  • @SeçkinSavaşçı i need to remove cl.exe from the PATH ? Nov 17, 2012 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.