Two ways of building an executable from C++ files
Create a
compile.bat file that contains one of the statements below:
-
build using IDE engine from command line:
devenv mySolution.sln
/rebuild debug
-
build using VC++ compiler from command line:
cl /DTEST_MYMODULE /EHsc
MyModule.cpp
MySolution is the sln file generated by the IDE when you
created a solution.
MyModel is the name of a module you want to
build.
TEST_MYMODULE is the value of the string in #ifdef xxx preprocessor
directive before the module's test stub main function.
You can see all of the options accepted by devenv using the command line
command: devenv /?
The options available from the C++ compiler are show with
the command line command: cl /?
Note that this assumes that devenv and cl are on your path. If not, you will
need to preface them with the full path to their locations. You can find that
with start\search in windows.
Executing your project:
Create a run.bat file that runs your
executuable, supplying it with all the command line options and file patterns it
needs to demonstrate that you meet all project requirements.
- myExe.exe /n2 *.h *.cpp