help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Cannot get gsl_rng to work


From: Kevin Lansing
Subject: [Help-gsl] Cannot get gsl_rng to work
Date: Sun, 15 Jun 2008 19:53:36 -0700

Hi,

I am new to using the GSL so I apologize in advance if there is a very easy
fix to my silly problem.

I am trying to run this code which I found on the GSL website, just to check
that I am able to use the functions.

     #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");
       gsl_rng_free (r);
       return 0;
     }

It gives me the following error: " error LNK2019: unresolved external symbol
_gsl_rng_default referenced in function _main ".

Have I not installed GSL properly? I've already tried out a few functions
such as creating a matrix and using Cholesky decomposition without any
problems. I am using VC++ Express 2005.

Thank you,
Kevin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]