* Question: link to wrong library
@ 2018-01-21 14:44 陶青云
2018-01-22 1:07 ` Nala Ginrut
0 siblings, 1 reply; 9+ messages in thread
From: 陶青云 @ 2018-01-21 14:44 UTC (permalink / raw)
To: guile-devel
[-- Attachment #1: Type: text/plain, Size: 904 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 1494 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-21 14:44 Question: link to wrong library 陶青云
@ 2018-01-22 1:07 ` Nala Ginrut
2018-01-22 4:58 ` Chaos Eternal
0 siblings, 1 reply; 9+ messages in thread
From: Nala Ginrut @ 2018-01-22 1:07 UTC (permalink / raw)
To: 陶青云; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]
I think you may need LD_LIBRARY_PATH
2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com>写道:
> 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.
>
[-- Attachment #2: Type: text/html, Size: 1897 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-22 1:07 ` Nala Ginrut
@ 2018-01-22 4:58 ` Chaos Eternal
2018-01-22 11:30 ` 陶青云
0 siblings, 1 reply; 9+ messages in thread
From: Chaos Eternal @ 2018-01-22 4:58 UTC (permalink / raw)
To: Nala Ginrut; +Cc: guile-devel, 陶青云
[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]
or try this
LDFLAGS=-Wl,-rpath
On Mon, Jan 22, 2018, 09:08 Nala Ginrut <nalaginrut@gmail.com> wrote:
> I think you may need LD_LIBRARY_PATH
>
> 2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com>写道:
>
>> 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.
>>
>
[-- Attachment #2: Type: text/html, Size: 2257 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-22 4:58 ` Chaos Eternal
@ 2018-01-22 11:30 ` 陶青云
2018-01-22 11:36 ` Chaos Eternal
0 siblings, 1 reply; 9+ messages in thread
From: 陶青云 @ 2018-01-22 11:30 UTC (permalink / raw)
To: Chaos Eternal, Nala Ginrut; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 2500 bytes --]
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"<eternalchaos@shlug.org>;
Date: Mon, Jan 22, 2018 12:58 PM
To: "Nala Ginrut"<nalaginrut@gmail.com>;
Cc: "陶青云"<qingyun.tao@tophant.com>; "guile-devel"<guile-devel@gnu.org>;
Subject: Re: Question: link to wrong library
or try this
LDFLAGS=-Wl,-rpath
On Mon, Jan 22, 2018, 09:08 Nala Ginrut <nalaginrut@gmail.com> wrote:
I think you may need LD_LIBRARY_PATH
2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com>写道:
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.
[-- Attachment #2: Type: text/html, Size: 4958 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-22 11:30 ` 陶青云
@ 2018-01-22 11:36 ` Chaos Eternal
2018-01-22 12:56 ` 陶青云
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Chaos Eternal @ 2018-01-22 11:36 UTC (permalink / raw)
To: 陶青云; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]
gcc -pthread -I. -Wl,-rpath -lguile-2.2 -lgc test.c
On Mon, Jan 22, 2018 at 7:30 PM 陶青云 <qingyun.tao@tophant.com> 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"<eternalchaos@shlug.org>;
> *Date: * Mon, Jan 22, 2018 12:58 PM
> *To: * "Nala Ginrut"<nalaginrut@gmail.com>;
> *Cc: * "陶青云"<qingyun.tao@tophant.com>; "guile-devel"<guile-devel@gnu.org>;
>
> *Subject: * Re: Question: link to wrong library
>
>
> or try this
> LDFLAGS=-Wl,-rpath
>
> On Mon, Jan 22, 2018, 09:08 Nala Ginrut <nalaginrut@gmail.com> wrote:
>
>> I think you may need LD_LIBRARY_PATH
>>
>> 2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com>写道:
>>
>>> 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.
>>>
>>
[-- Attachment #2: Type: text/html, Size: 5658 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-22 11:36 ` Chaos Eternal
@ 2018-01-22 12:56 ` 陶青云
2018-01-22 13:10 ` Chaos Eternal
2018-01-22 12:59 ` Nala Ginrut
2018-01-23 1:14 ` Matt Wette
2 siblings, 1 reply; 9+ messages in thread
From: 陶青云 @ 2018-01-22 12:56 UTC (permalink / raw)
To: Chaos Eternal; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 3060 bytes --]
Sadly, also not work. I just want to write a C program link with libguile that compile from source.
------------------ Original ------------------
From: "Chaos Eternal"<eternalchaos@shlug.org>;
Date: Mon, Jan 22, 2018 07:36 PM
To: "陶青云"<qingyun.tao@tophant.com>;
Cc: "Nala Ginrut"<nalaginrut@gmail.com>; "guile-devel"<guile-devel@gnu.org>;
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 陶青云 <qingyun.tao@tophant.com> 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"<eternalchaos@shlug.org>;
Date: Mon, Jan 22, 2018 12:58 PM
To: "Nala Ginrut"<nalaginrut@gmail.com>;
Cc: "陶青云"<qingyun.tao@tophant.com>; "guile-devel"<guile-devel@gnu.org>;
Subject: Re: Question: link to wrong library
or try this
LDFLAGS=-Wl,-rpath
On Mon, Jan 22, 2018, 09:08 Nala Ginrut <nalaginrut@gmail.com> wrote:
I think you may need LD_LIBRARY_PATH
2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com>写道:
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.
[-- Attachment #2: Type: text/html, Size: 6666 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-22 11:36 ` Chaos Eternal
2018-01-22 12:56 ` 陶青云
@ 2018-01-22 12:59 ` Nala Ginrut
2018-01-23 1:14 ` Matt Wette
2 siblings, 0 replies; 9+ messages in thread
From: Nala Ginrut @ 2018-01-22 12:59 UTC (permalink / raw)
To: Chaos Eternal; +Cc: guile-devel, 陶青云
[-- Attachment #1: Type: text/plain, Size: 2982 bytes --]
Or run it with LD_LIBRARY_PATH
2018年1月22日 19:36,"Chaos Eternal" <eternalchaos@shlug.org>写道:
> gcc -pthread -I. -Wl,-rpath -lguile-2.2 -lgc test.c
>
> On Mon, Jan 22, 2018 at 7:30 PM 陶青云 <qingyun.tao@tophant.com> 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"<eternalchaos@shlug.org>;
>> *Date: * Mon, Jan 22, 2018 12:58 PM
>> *To: * "Nala Ginrut"<nalaginrut@gmail.com>;
>> *Cc: * "陶青云"<qingyun.tao@tophant.com>; "guile-devel"<guile-devel@gnu.org>;
>>
>> *Subject: * Re: Question: link to wrong library
>>
>>
>> or try this
>> LDFLAGS=-Wl,-rpath
>>
>> On Mon, Jan 22, 2018, 09:08 Nala Ginrut <nalaginrut@gmail.com> wrote:
>>
>>> I think you may need LD_LIBRARY_PATH
>>>
>>> 2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com>写道:
>>>
>>>> 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.
>>>>
>>>
[-- Attachment #2: Type: text/html, Size: 6122 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-22 12:56 ` 陶青云
@ 2018-01-22 13:10 ` Chaos Eternal
0 siblings, 0 replies; 9+ messages in thread
From: Chaos Eternal @ 2018-01-22 13:10 UTC (permalink / raw)
To: 陶青云; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 3428 bytes --]
sorry,
you missed the -L flag
On Mon, Jan 22, 2018 at 8:56 PM 陶青云 <qingyun.tao@tophant.com> wrote:
> Sadly, also not work. I just want to write a C program link with libguile
> that compile from source.
>
>
> ------------------ Original ------------------
> *From: * "Chaos Eternal"<eternalchaos@shlug.org>;
> *Date: * Mon, Jan 22, 2018 07:36 PM
> *To: * "陶青云"<qingyun.tao@tophant.com>;
> *Cc: * "Nala Ginrut"<nalaginrut@gmail.com>; "guile-devel"<
> guile-devel@gnu.org>;
> *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 陶青云 <qingyun.tao@tophant.com> 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"<eternalchaos@shlug.org>;
>> *Date: * Mon, Jan 22, 2018 12:58 PM
>> *To: * "Nala Ginrut"<nalaginrut@gmail.com>;
>> *Cc: * "陶青云"<qingyun.tao@tophant.com>; "guile-devel"<guile-devel@gnu.org>;
>>
>> *Subject: * Re: Question: link to wrong library
>>
>>
>> or try this
>> LDFLAGS=-Wl,-rpath
>>
>> On Mon, Jan 22, 2018, 09:08 Nala Ginrut <nalaginrut@gmail.com> wrote:
>>
>>> I think you may need LD_LIBRARY_PATH
>>>
>>> 2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com>写道:
>>>
>>>> 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.
>>>>
>>>
[-- Attachment #2: Type: text/html, Size: 7383 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: link to wrong library
2018-01-22 11:36 ` Chaos Eternal
2018-01-22 12:56 ` 陶青云
2018-01-22 12:59 ` Nala Ginrut
@ 2018-01-23 1:14 ` Matt Wette
2 siblings, 0 replies; 9+ messages in thread
From: Matt Wette @ 2018-01-23 1:14 UTC (permalink / raw)
To: guile-devel
[-- Attachment #1: Type: text/plain, Size: 3505 bytes --]
I think you need -Wl,-rpath=`pwd`/libguile/.libs
On 01/22/2018 03:36 AM, Chaos Eternal wrote:
> gcc -pthread -I. -Wl,-rpath -lguile-2.2 -lgc test.c
>
> On Mon, Jan 22, 2018 at 7:30 PM 陶青云 <qingyun.tao@tophant.com
> <mailto:qingyun.tao@tophant.com>> 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"<eternalchaos@shlug.org
> <mailto:eternalchaos@shlug.org>>;
> *Date: * Mon, Jan 22, 2018 12:58 PM
> *To: * "Nala Ginrut"<nalaginrut@gmail.com
> <mailto:nalaginrut@gmail.com>>;
> *Cc: * "陶青云"<qingyun.tao@tophant.com
> <mailto:qingyun.tao@tophant.com>>;
> "guile-devel"<guile-devel@gnu.org <mailto:guile-devel@gnu.org>>;
> *Subject: * Re: Question: link to wrong library
>
> or try this
> LDFLAGS=-Wl,-rpath
>
>
> On Mon, Jan 22, 2018, 09:08 Nala Ginrut <nalaginrut@gmail.com
> <mailto:nalaginrut@gmail.com>> wrote:
>
> I think you may need LD_LIBRARY_PATH
>
> 2018年1月21日 23:46,"陶青云" <qingyun.tao@tophant.com
> <mailto:qingyun.tao@tophant.com>>写道:
>
> 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 <http://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.
>
[-- Attachment #2: Type: text/html, Size: 9341 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-01-23 1:14 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-21 14:44 Question: link to wrong library 陶青云
2018-01-22 1:07 ` Nala Ginrut
2018-01-22 4:58 ` Chaos Eternal
2018-01-22 11:30 ` 陶青云
2018-01-22 11:36 ` Chaos Eternal
2018-01-22 12:56 ` 陶青云
2018-01-22 13:10 ` Chaos Eternal
2018-01-22 12:59 ` Nala Ginrut
2018-01-23 1:14 ` Matt Wette
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).