This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: to compile a simple program with gsl




achim@Sparcy02> gcc -c -I/zpr/gnu/include/gsl demo.c

This caueses errors, just because the gsl headers themself use
include-paths like gsl/gsl_math.h, that can't be found.

Please use #include <gsl/gsl_*.h> ,too.

The command 

achim@Sparcy02> gsl-config --cflags
-I/zpr/gnu/include

gives you the flags for compiling gsl-programs:

achim@Sparcy02> gcc -c -I/zpr/gnu/include demo.c

results in demo.o

The same procedure for linking:

achim@Sparcy02> gsl-config --libs
-L/zpr/gnu/lib -lgsl -lgslcblas -lm
achim@Sparcy02> gcc -o demo demo.o -L/zpr/gnu/lib -lgsl -lgslcblas -lm

achim@Sparcy02> ./demo 
 6 3 6 3 4 7 4 6 4 3

I think, this is the full truth.

Achim Gaedke, ZPR
Weyertal 80, 50931 Köln
Tel: +49 221 470 6021

On Mon, 11 Mar 2002, Mael Guillemot wrote:

> Thanks for felping me:
> 
> I have the latest version of gsl: gsl-1.1 downloaded from
> http://sources.redhat.com/gsl
> 
> At the beggining of the tutorial for compiling and linking, they speak
> directly about linking without any indication of compiling.
> 
> Could you show me how do you compile a program who use gsl ?
> 
> Thank you,
> 
> Mael
> 
> 
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]