[Top][All Lists]

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

Re: [Help-gsl] GSL in Xcode 3.2.6

From: Steve Brosnan
Subject: Re: [Help-gsl] GSL in Xcode 3.2.6
Date: Sat, 2 Feb 2013 09:46:33 -0800


I think what is lacking is that the libraries have not been statically linked 
with your Xcode project. I'm using a current version of Xcode (4.6) and my 
memory is a bit fuzzy on your version, but I believe that what is needed is to 
find your libraries in the Finder (via Go/Go to Folder, and type /usr/local/lib 
into the search box). Then drag the library into the area of your project in 
Xcode. That sets it up to statically link. Make sure that the library (.dylib) 
icon is truly within your project (i.e. indented evenly with your source files 
or group folders).

One more thing -- your description did not explicitly say that you installed 
the gsl with the 'sudo make install' command. That is needed to put them into 
the system directories, /usr/local/include & /usr/local/lib. But since 
gsl-config gave the correct output, I'll assume that you did it all correctly.

Hope this helps,


> Date: Sat, 2 Feb 2013 09:32:14 +0000
> From: Jack Jelfs <address@hidden>
> To: address@hidden
> Subject: [Help-gsl] GSL in Xcode 3.2.6.
> Message-ID:
>       <address@hidden>
> Content-Type: text/plain; charset=ISO-8859-1
> 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
> - 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]