| GNU Scientific Library Reference Manual - Revised Second Edition (v1.8) by M. Galassi, J. Davies, J. Theiler, B. Gough, G. Jungman, M. Booth, F. Rossi Paperback (6"x9"), 636 pages, 60 figures ISBN 0954161734 RRP £24.99 ($39.99) |
2.2 Compiling and Linking
The library header files are installed in their own ‘gsl’ directory. You should write any preprocessor include statements with a ‘gsl/’ directory prefix thus,
#include <gsl/gsl_math.h>
If the directory is not installed on the standard search path of your
compiler you will also need to provide its location to the preprocessor
as a command line flag. The default location of the ‘gsl’
directory is ‘/usr/local/include/gsl’. A typical compilation
command for a source file ‘example.c’ with the GNU C compiler
gcc is,
$ gcc -Wall -I/usr/local/include -c example.c
This results in an object file ‘example.o’. The default
include path for gcc searches ‘/usr/local/include’ automatically so
the -I option can actually be omitted when GSL is installed
in its default location.
| ISBN 0954161734 | GNU Scientific Library Reference Manual - Revised Second Edition (v1.8) | See the print edition |