* A problem compiling and linking gsl
@ 2002-10-22 7:53 cgarnica
2002-10-22 10:08 ` Wartan Hachaturow
0 siblings, 1 reply; 2+ messages in thread
From: cgarnica @ 2002-10-22 7:53 UTC (permalink / raw)
To: gsl-discuss
Hi!
I've just downloaded gsl and I've installed the libs, bins, includes, etc. When I tried to test a program the following message pops up (this was using the random distribution library, but it happens with all libraries):
C:\WINDOWS\TEMP\ccw9aaaa.o(.text+0x2c):testal~1.cpp: undefined reference to `gsl_rng_env_setup'
C:\WINDOWS\TEMP\ccw9aaaa.o(.text+0x31):testal~1.cpp: undefined reference to `gsl_rng_default'
C:\WINDOWS\TEMP\ccw9aaaa.o(.text+0x40):testal~1.cpp: undefined reference to `gsl_rng_alloc'
C:\WINDOWS\TEMP\ccw9aaaa.o(.text+0x71):testal~1.cpp: undefined reference to `gsl_ran_poisson'
I don't know why it displays something about C:\WINDOWS\TEMP\ and why does it say "undefined reference".
I'm using Dev-C++ 4.
By the way, below is the code of the test program:
Thanks for help,
Carlos Andrés Garnica
#include <stdio.h>
#include <gsl\gsl_rng.h>
#include <gsl\gsl_randist.h>
int
main (void)
{
const gsl_rng_type * T;
gsl_rng * r;
int i, n = 10;
double mu = 3.0;
/* create a generator chosen by the
environment variable GSL_RNG_TYPE */
gsl_rng_env_setup();
T = gsl_rng_default;
r = gsl_rng_alloc (T);
/* print n random variates chosen from
the poisson distribution with mean
parameter mu */
for (i = 0; i < n; i++)
{
unsigned int k = gsl_ran_poisson (r, mu);
printf(" %u", k);
}
printf("\n");
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: A problem compiling and linking gsl
2002-10-22 7:53 A problem compiling and linking gsl cgarnica
@ 2002-10-22 10:08 ` Wartan Hachaturow
0 siblings, 0 replies; 2+ messages in thread
From: Wartan Hachaturow @ 2002-10-22 10:08 UTC (permalink / raw)
To: gsl-discuss
On Tue, Oct 22, 2002 at 09:19:44AM -0500, cgarnica@007mundo.com wrote:
> C:\WINDOWS\TEMP\ccw9aaaa.o(.text+0x71):testal~1.cpp: undefined reference to `gsl_ran_poisson'
You've forgot to link your program with gsl. Read the appropriate
documentation -- I've no idea where libraries to link with are set
up in Windows world.
--
Regards, Wartan.
"Computers are not intelligent. They only think they are."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-10-22 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-22 7:53 A problem compiling and linking gsl cgarnica
2002-10-22 10:08 ` Wartan Hachaturow
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).