guile-devel
[Top][All Lists]
Advanced

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

Re: Question: link to wrong library


From: 陶青云
Subject: Re: Question: link to wrong library
Date: Mon, 22 Jan 2018 20:56:44 +0800

Sadly, also not work.  I just want to write a C program link with libguile that compile from source.
 
 
------------------ Original ------------------
Date:  Mon, Jan 22, 2018 07:36 PM
To:  "陶青云"<address@hidden>;
Cc:  "Nala Ginrut"<address@hidden>; "guile-devel"<address@hidden>;
Subject:  Re: Question: link to wrong library
 
 gcc  -pthread -I.  -Wl,-rpath -lguile-2.2  -lgc test.c

On Mon, Jan 22, 2018 at 7:30 PM 陶青云 <address@hidden> wrote:
some result

```
~/code/guile-2.2
$ LDFLAGS=-Wl,-rpath LD_LIBRARY_PATH=./libguile/.libs gcc  -pthread -I.  -lguile-2.2  -lgc test.c
~/code/guile-2.2
$ ldd ./a.out 
linux-vdso.so.1 (0x00007ffc441a0000)
libguile-2.2.so.1 => /usr/lib/libguile-2.2.so.1 (0x00007f3cfb519000)
libgc.so.1 => /usr/lib/libgc.so.1 (0x00007f3cfb2af000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f3cfb091000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f3cfacd9000)
libffi.so.6 => /usr/lib/libffi.so.6 (0x00007f3cfaad0000)
libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007f3cfa75f000)
libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f3cfa4cc000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007f3cfa2c2000)
libcrypt.so.1 => /usr/lib/libcrypt.so.1 (0x00007f3cfa08a000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f3cf9d3e000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f3cfba49000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f3cf9b3a000)
libatomic_ops.so.1 => /usr/lib/libatomic_ops.so.1 (0x00007f3cf9937000)
```
 
 
------------------ Original ------------------
From:  "Chaos Eternal"<address@hidden>;
Date:  Mon, Jan 22, 2018 12:58 PM
To:  "Nala Ginrut"<address@hidden>;
Cc:  "陶青云"<address@hidden>; "guile-devel"<address@hidden>;
Subject:  Re: Question: link to wrong library
 

or try this
LDFLAGS=-Wl,-rpath


On Mon, Jan 22, 2018, 09:08 Nala Ginrut <address@hidden> wrote:
I think you may need LD_LIBRARY_PATH

2018年1月21日 23:46,"陶青云" <address@hidden>写道:
Hi. I'm new to guile.  I compiled it from source without `make install`. 

I write a simple C file and use the flowing command to compile it.
    `gcc -pthread -I. -L ./libguile/.libs -lguile-2.2  -lgc test.c`
it successed. but the a.out is always link to my system guile library.
   $ ldd ./a.out 
linux-vdso.so.1 (0x00007fffc259b000)
libguile-2.2.so.1 => /usr/lib/libguile-2.2.so.1 (0x00007fa90f9fe000)
libgc.so.1 => /usr/lib/libgc.so.1 (0x00007fa90f794000)


even I do the flowing:
$ cp libguile/.libs/libguile-2.2.so.1.3.0  libguile/.libs/libguile-2.5.so

$ gcc -pthread -I. -L ./libguile/.libs -lguile-2.5  -lgc test.c  # it successed

$ ldd ./a.out 
linux-vdso.so.1 (0x00007ffd283e0000)
libguile-2.2.so.1 => /usr/lib/libguile-2.2.so.1 (0x00007f83c71cc000)
libgc.so.1 => /usr/lib/libgc.so.1 (0x00007f83c6f62000)


Could someone give me some tips.  Thanks.

reply via email to

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