If you want to compile your console applications from command line, just use the CL.EXE command tool. This is the Microsoft compiler. Imagine you have two files : ConsoleApp1 and Function1.cpp. To compile, just use this:
CL /EHsc ConsoleApp1 Function1
The /EHsc flag is about exception handling.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80×86
Copyright (C) Microsoft Corporation. All rights reserved.
consoleapp1.cpp
function1.cpp
Generating Code…
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:consoleapp1.exe
consoleapp1.obj
function1.obj
The result is a console application named consoleapp1.exe.
Tagged: C++
Leave a Reply