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: Problem with compiling program


Please follow the instructions given in gsl-reference section 2.2

You should be able to complie

gcc trial.c -o trail -L/where/gsl/lies/lib -lgsl

replace the Path /where/gsl/lies with the gsl install-prefix. Now, it should compile. You may have to modify the environment variable LD_LIBRARY_PATH to let the program know where the library file libgsl.so lies.

But all this stuff can be read at the second chapter of gsl-reference, available online at http://sources.redhat.com/gsl/ref/gsl-ref_2.html#SEC10
or using the info files.


Achim

V Karthik wrote:

I recently installed GSL with the default options by
first executing './configure' and then 'make' and then
'make install'. But when I try to compile and run this
example example program given in the manual i get the
following error message.


The C program is

#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>

int main(void) {
 double x = 5.0;
 double y = gsl_sf_bessel_J0(x);
 printf("J0(%g) = %.18e\n",x,y);
 return 0;
}

Error Message:

# gcc trial.c
/tmp/ccu8pcOy.o: In function `main':
/tmp/ccu8pcOy.o(.text+0x28): undefined reference to
`gsl_sf_bessel_J0'
collect2: ld returned 1 exit status

I've tried to provide full path for heared files and
libraries while compiling and linking but to no avail.
Could someone please help me.

Thanks
Karthik

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com







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