Appendix B. Programming Tools

In this chapter, we introduce some basic programming tools that can help us to achieve our programming goals.

B.1 gcc

One of the most popular C++ compilers is g++, the C++ version of the C compiler gcc. The acronym used to stand for Gnu C Compiler, but the compiler supports several other languages (Fortran, D, Ada, . . .) and the name was changed to Gnu Compiler Collection while keeping the acronym. This section gives a short introduction to how to use it.

The following command:

g++ -o hello hello.cpp

compiles the C++ source file hello.cpp into the executable hello. The flag -o can be omitted. Then the executable will be named a.out (for bizarre historical reasons as an abbreviation of “assembler output”). As soon ...

Get Discovering Modern C++: An Intensive Course for Scientists, Engineers, and Programmers 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.