[Top][All Lists]

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

Re: [Help-gsl] I have got problems with library...

From: Donald Tournier
Subject: Re: [Help-gsl] I have got problems with library...
Date: Thu, 27 Apr 2006 15:31:55 +1000


It sounds like the compilation works fine, so gcc obviously does find
the right (shared) libraries at compile time, but the system can't find
the required shared libraries to link with at run time. This is strange,
since it looks like you disabled shared linking when building the
library. In any case, it looks like the compiler is using dynamic rather
than static libraries. There's a couple of things you can try. 

First, try to figure out how to get gcc to use the static libraries at
the linking stage (you might need to add the appropriate flag for gcc,
or supply the whole library name - libgsl.a or something like that). Try
'man gcc' - warning: it's a very long manual.

Otherwise, you can just use the shared libraries anyway. Try to locate
the file (most likely in /usr/local/lib), and add it to the
library search path, using 'export LD_LIBRARY_PATH=/usr/local/lib' or
equivalent before issuing your './1.out' command . Finally, if the file doesn't exist, but you can find the library under the
name or or something like this, you can create a
symlink to it with the correct name so that the system can find it.
Command for that is 'ln -s' (edit as
appropriate). You'll probably need root privileges for that, and you
should issue the command from the same directory.

Hope that helps.


On Wed, 2006-04-26 at 20:44 +0400, s d wrote:
> Good day.
> I have got some problems, may be I do something incorrect. I have got Fedora
> Core 5 x86_64 installed on my computer. I have installed gsl-1.8. Then I
> have wrote a programm, actually I took the programm code from one of
> examples, compiled it with command
> # gcc 1.c -o 1.out -lgsl -lgslcblas
> then I enter the command
> # ./1.out
> and I have got an error:
> ./1.out: error while loading shared libraries: cannot open
> shared object file: No such file or directory
> Why have I such an error? And what shall I do to avoid it? Here is the text
> of file 1.c
> #include <stdio.h>
> #include </usr/local/include/gsl/gsl_permutation.h>
> int main(void){
>     gsl_permutation * p = gsl_permutation_alloc(3);
>     gsl_permutation_init (p);
>     do{
>         gsl_permutation_fprintf (stdout, p, " %u");
>         printf("\n");
>     }
>     while (gsl_permutation_next(p)==GSL_SUCCESS);
>     return 0;
> }
> I installed the library with commands
> # ./configure --disable-shared
> # make
> # make install
> And I have got such bad results, as written above. May be I am doing
> something wrong, while compiling the file 1.c. Or I have made something
> wrong while installing the library.
> Would you be so kind to help me? Please....
> Hope to hearing from you soon.
> Serj
> _______________________________________________
> Help-gsl mailing list
> address@hidden

reply via email to

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