help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] GSL in Xcode 3.2.6.


From: Jack Jelfs
Subject: [Help-gsl] GSL in Xcode 3.2.6.
Date: Sat, 2 Feb 2013 09:32:14 +0000

Hi everyone,

I'm not a massively experienced programmer, but I'm trying to install and
use GSL on a Macbook running OS 10.6.8. I want to use them in C++ programs
in Xcode.  My version of Xcode is 3.2.6. The version of GSL I've been
trying is 1.14, which I think is compatible with my setup.

I've followed the installation instructions several times - change
directory to the unpacked GSL file, use "./configure" and "make" - and
Terminal looks like it's installing the files. If I then use "gsl-config
--cflags --libs-without-cblas" then Terminal can find the libraries in
/usr/local/include and /usr/local/lib -lgsl -lm.

If I then set up Xcode following the standard instructions found online -
changing the Header Search Paths etc, such as found here
http://www.os-scientific.org/devel/gslxcode/index - and try to compile a
program that calls the GSL routines, for instance this:

/* test_rng.c */
#include <stdio.h>#include <gsl/gsl_rng.h>

gsl_rng * r;  /* global generator */
int
main (void)
{
   const gsl_rng_type * T;

   gsl_rng_env_setup();

   T = gsl_rng_default;
   r = gsl_rng_alloc (T);

   printf ("generator type: %s\n", gsl_rng_name (r));
   printf ("seed = %lu\n", gsl_rng_default_seed);
   printf ("first value = %lu\n", gsl_rng_get (r));

   gsl_rng_free (r);
   return 0;
}

then I just get a string of errors along the lines of
""_gsl_rng_free", referenced from: -main in test_rng.o". I.e. it
doesn't seem to be finding the GSL files.

I'm sure I'm doing something pretty obviously wrong, can anyone help?

Thanks! Jack


reply via email to

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