public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* Problem with compiling program
@ 2003-05-17 12:46 V Karthik
  2003-05-18 11:28 ` Achim Gädke
  0 siblings, 1 reply; 2+ messages in thread
From: V Karthik @ 2003-05-17 12:46 UTC (permalink / raw)
  To: gsl-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problem with compiling program
  2003-05-17 12:46 Problem with compiling program V Karthik
@ 2003-05-18 11:28 ` Achim Gädke
  0 siblings, 0 replies; 2+ messages in thread
From: Achim Gädke @ 2003-05-18 11:28 UTC (permalink / raw)
  To: V Karthik, gsl-discuss

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
>
>  
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-18 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-17 12:46 Problem with compiling program V Karthik
2003-05-18 11:28 ` Achim Gädke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).