Some of the more important compiler options a beginner should know about are:-
g++
command is in fact a driver that can run both the compiler and linker
and for trivial programs its convenient to compile and link in a
single step. However for projects of any significant size, its normal
to keep the two steps separate.
#ifdef
preprocessor. For example you could
have extra printout that's not normally executed by using for example
a VERBOSE
macro:-
#ifdef VERBOSE // verbose code goes here ... #endif
By default, such code is disabled but could be switched on with:-
g++ -DVERBOSE ...
The option can be used any number of times to define macros as required.
#include
files, see section 6.1.2. The option can
be used any number of times to define additional directories to be
searched e.g.:-
g++ -I/home/software/include -IMyCode/include ...