[PLUG] Path statement

Robert Kopp iconoklastic at yahoo.com
Tue Dec 3 07:29:18 UTC 2002


This (advice below) seemed like a good idea to me, so
I tried it. Only the test file was called "gslfirst.c"

#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;
}

--- Anthony Schlemmer <aschlemm at attbi.com> wrote:
If you 
> have multiple directories you can specify the -I
> argument multiple 
> times on the command line. For telling the linker
> what directories to 
> locate libraries in you use the -L argument
> 
> e.g.
> 
> gcc -I/usr/local/include -c world.c
> 
> Assuming you have a library named libgsl in
> /usr/local/lib you can link 
> to it using the following command.
> 
> gcc -L/usr/local/lib -lgsl -o world world.o
> 

I should use such a command to perform the linking.
I've despaired of doing it any other way, since
LD_LIBRARY_PATH is nowhere to be found. Unfortunately,
it didn't go down, as a segment of the output below
shows. After that I have appended a listing of the
content of the /usr/local/lib directory.

[rtk at analytic rtk]$ gcc -I/usr/local/include -c
gslfirst.c

Ok here, apparently.

[rtk at analytic rtk]$ gcc -L/usr/local/lib -lgsl -o
gslfirst gslfirst.o

/usr/local/lib/libgsl.so: undefined reference to
`cblas_dsdot'
/usr/local/lib/libgsl.so: undefined reference to
`cblas_dswap'
/usr/local/lib/libgsl.so: undefined reference to
`cblas_zaxpy'
And on, and on, and on...

Contents of directory /usr/local/lib:
electric       libgslcblas.la    libgslcblas.so.0.0.0 
libgsl.so.0
libgsl.a       libgslcblas.so    libgsl.la            
libgsl.so.0.3.0
libgslcblas.a  libgslcblas.so.0  libgsl.so  

I don't give up easily. Any further comments would be
welcome.          


=====
Robert "Tim" Kopp
http://analytic.tripod.com/

"SAMBA--opening Windows to a wider world."




More information about the PLUG mailing list