Using MSVC++ Compiler From the Command Line

Started by
7 comments, last by Lucidquiet 20 years, 2 months ago
Is it possible to use MSVC++ Compiler from the command line -- and how? That is my question. I''m not even sure where to start with this, but I hope it can be done. I realize that getting any of the project management out of MSVC++ is probably hopeless from the command line but is there a way to at least get the Compiler Out of the IDE -- so to speak? thanks, L- " ''No one has control -- control is just a fantasy. And being human is difficult.'' "
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
Advertisement
There should be a vcvars32.bat file in a \bin subdirectory of your MSVC installation. Run that from the command line and it should set up the environment variables necessary to use MSVC from the command line. The C++ compiler is cl.exe, the linker is link.exe and the make program is nmake.exe.
Thanks, that seems to work just great.

I was looking at the size of the cl.exe, and link.exe as executables, and they are amazingly tiny, any body have any ideas on that -- I mean I suppose everything it needs is dynamically linked.

Thanks,
L-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
The executables may be tiny, but there should be some fairly sizable dlls in the directory.
It is also possible to invoke the VC++ IDE executable on a workspace file(we are talking VC++6 here, right?) in order to build it from the command line.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
.NET still has that capability. (Well a solution file, not a workspace file, but the same idea.)
LucidQuiet: you will find that you can create remarkably tiny individual binaries by modifying options, but bear in mind that these are loading and calling DLLs which is a little less efficient than executing staticly linked files.

To see which dependancies are needed for a program use Dependancy Walker (depends.exe) which is part of either the Platform SDK, or Microsoft .NET SDK, and IIRC is installed with Visual Studio Professional.

Dependency Walker home page
Thanks everyone... I appreciate all of your answers/post -- pretty amazing really, I didn''t know this stuff... not the foggiest. Thanks for the link to Dependency Walker -- nice.

Thanks, again,
L-

" ''No one has control -- control is just a fantasy. And being human is difficult.'' "
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net

This topic is closed to new replies.

Advertisement