Sometimes we write small prototype console applications to test any functions or learn C++ features. It would be nice just to edit .cpp file and get .exe compiled at once, like Linux guys can do just by entering gcc command.
What you have to do - just to mimic
Start->All-Programs->Microsoft Visual Studio 2008->Visual Studio Tools->Visual Studio 2008 Command Prompt, which simply calls
and get list of variables by command
In my case I've added:
Now enjoy writing prototypes by pressing Enter on .cpp files and having .exe in response!
What you have to do - just to mimic
Start->All-Programs->Microsoft Visual Studio 2008->Visual Studio Tools->Visual Studio 2008 Command Prompt, which simply calls
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
and get list of variables by command
set > env1.lstthen, from your beloved and best one file manager, FAR, get another list of variables by command
set > env2.lstNow with any merge tool you can get what is missing in env2.lst:
winmerge env1.lst env2.lstand add variables manually from Computer->Properties->Advanced System Settings->Advanced->Environment variables...
In my case I've added:
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE
PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools;C:\windows\Microsoft.NET\Framework\v3.5;C:\windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCPackages;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;%PATH%
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include;
LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib;
LIBPATH=C:\windows\Microsoft.NET\Framework\v3.5;C:\windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB;Then restart FAR to obtain new variables and add File assiciation via menu Command->File associations:
*.cpp;*.cc;*.hpp;*.c
cl !/!.!
Now enjoy writing prototypes by pressing Enter on .cpp files and having .exe in response!
This method has a drawback, when you install VS2013
ReplyDelete