58Chapter3 Compilers and Assemblers
You can place include files in other directories if you have set the
environment variable. Setting this variable to
using the following command will include
directory also in the search list. Also note that order is once again extremely important.
export C_INCLUDE_PATH=/opt
If you again execute the
gcc v E
path will be included in the last
part of the output.
To set additional include paths permanently for all users, it is a good idea to add a line with
the export command in
file. Manual Pages Path
To be able to use manual pages installed with GCC, you have to add a line in the
file. This will enable the
command to also look into the
directory when searching for manual pages. The line looks like the following:
MANPATH /opt/gcc-3.0.4/man
Location of this line with respect to other
entries is important. If you put this
line after other entries, you will still get the same old man pages. That is why it is recommended
to put this entry BEFORE any other line that starts with
keyword in this file.
3.2.5What Not to Do when Installing Development Tools
When building GCC, dont build it into the source directory. I would also recommend not
installing your development tools in the default location (under
). Instead use
some place under the
directory. This way if something goes wrong, you can just delete
this directory under /opt without making any other change in the system. If you install these
tools in the default location, you may overwrite some existing files and may not be able to
reverse the installation process.
3.3Compiling a Program
The GCC compiler is commonly invoked using the
command. The command accepts many
command line switches that can be used to invoke different options for the compilation process.
You can use the same command line switch multiple times. For example, if you need to specify
multiple include paths, you can use
option multiple times. However you cant combine two
switches into one. For example
cant be combined as
. This section provides
information about different methods of compilation and things you need to consider in the com-
pilation process. Please note that in most of software development projects, you dont invoke
from the command line. Instead, the GNU
utility that reads one or many Makefiles
Next Page >>
<< Previous Page
Back to the Table of Contents