Visual C++ installed, but cannot find cl.exe?
-
Wednesday, March 14, 2012 8:52 PM
Hello,
I have Visual C++ installed, and I am able to create programs and compile them using the IDE, but I cannot find the actual file of the compiler anywhere on my computer. I know it is cl.exe is the compiler, but doing a search on my hard drive yields no results. I looked in the Microsoft.NET folder but it is not one of the applications there (along with csc.exe, etc.). I really would like to compile from my command line by adding cl.exe to my system path, but I can't do that until I actually find the location of cl.exe.
Thank you very much for any help.
All Replies
-
Wednesday, March 14, 2012 9:38 PM
Look in:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\binShould find it there.
You can also run vcvars32.bat from there to set up your environment.
Tom
- Marked As Answer by Sandros77 Sunday, March 18, 2012 8:17 PM
-
Wednesday, March 14, 2012 9:49 PM
Thank you very much.
Do you know if there is any way to run cl.exe without running the batch file every time? I'm assuming I would have to add some location to my system path, but I'm not sure which path would enable me to run cl.exe without any errors (from experience I know C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin doesn't work. I don't want to add some huge directory to my path though (maybe I can but my intuition is telling me too large a directory in the path is bad?).
-
Thursday, March 15, 2012 3:01 AM
Do you know if there is any way to run cl.exe without running the batch file every time? I'm assuming I would have to add some location to my system path, but I'm not sure which path would enable me to run cl.exe without any errors (from experience I know C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin doesn't work. I don't want to add some huge directory to my path though (maybe I can but my intuition is telling me too large a directory in the path is bad?).
Yes, adding stuff to PATH and is bad, and vcvars32.bat is created to avoid the enviroment pollution. If you don't like it - another bat file can help.
Put it in your project directory and click to open a command window where you can compile:
pushd "%~dp0" call [your VC_INSTALL_PATH]\VC\vcvarsall.bat cmd /k
-- pa
- Edited by Pavel A Thursday, March 15, 2012 3:01 AM
-
Thursday, March 15, 2012 3:06 AMWhy not simply use: Start, All Programs, Microsoft Visual Studio 2010, Visual Studio Tools, and select Visual Studio Command Prompt (2010)? You can issue a cl.exe command directly from there.
-
Thursday, March 15, 2012 11:15 PM
Why not simply use: Start, All Programs, Microsoft Visual Studio 2010, Visual Studio Tools, and select Visual Studio Command Prompt (2010)? You can issue a cl.exe command directly from there.
I have always had problems with that, probably just because I am a novice at using it. This makes it so that the cl.exe is accessible, but now the program I have to compile isn't. So I have to type "cl.exe (some long path)", which is just the same problem as I had before but now in a new format: before I would have to type "(some long path ending in /cl.exe) program.cc". -
Friday, March 16, 2012 12:56 AM
I have always had problems with that, probably just because I am a novice at using it. This makes it so that the cl.exe is accessible, but now the program I have to compile isn't. So I have to type "cl.exe (some long path)", which is just the same problem as I had before but now in a new format: before I would have to type "(some long path ending in /cl.exe) program.cc".
Nonsense. You can switch directories and still type in "cl Whatever.cpp" and the compiler will still launch. -
Sunday, March 18, 2012 8:18 PM
Ah I see. I had always thought that if I changed directories in the prompt then the initialized variables would no longer work.
Thank you very much for all your help.

