Compiling the code

Go to the command prompt and type cl /? command. Since the PATH environment is set up to include the path to the bin folder, you will see the help pages for the compiler. You can scroll through these pages by pressing the Return key until you get back to the command prompt. Most of these options are beyond the scope of this book, but the following table shows some that we will talk about:

Compiler Switch Description
/c Compile only, do not link.
/D<symbol> Defines the constant or macro <symbol>.
/EHsc Enable C++ exception handling but indicate that exceptions from extern ″C″ functions (typically operating system functions) are not handled.
/Fe:<file> Provide the name of the executable file to link to.
/Fo:<file> ...

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.