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

Re: Shared library major version number



On  2 Dic, Oliver Elphick wrote:
> How do I get gcc to link in the shared library major version number?
> 
> I get this:         
> gcc -o psql -L../../interfaces/libpq psql.o stringutils.o   -lpq -lcrypt -ldld 
> -lnsl -ldl
> -lm -lreadline -lhistory -lcurses  -export-dynamic -Wl,-rpath 
> -Wl,/usr/lib/postgresql/lib
> 
> linda:/usr/src/postgresql-6.2.1$ ldd debian/tmp/usr/bin/psql
>         libpq.so => /usr/lib/postgresql/lib/libpq.so (0x4000c000)
>               ^^                                  ^^I
>         libcrypt.so.1 => /lib/libcrypt.so.1 (0x4001c000)
>         libnsl.so.1 => /lib/libnsl.so.1 (0x40049000)
>         libdl.so.2 => /lib/libdl.so.2 (0x4004f000)
>         libm.so.6 => /lib/libm.so.6 (0x40052000)
>         libreadline.so.2 => /lib/libreadline.so.2 (0x4006b000)
>         libhistory.so.2 => /usr/lib/libhistory.so.2 (0x4008d000)
>         libncurses.so.3.4 => /lib/libncurses.so.3.4 (0x40095000)
>         libc.so.6 => /lib/libc.so.6 (0x400da000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
> 
> linda:/usr/src/postgresql-6.2.1$ /sbin/ldconfig -p | grep libpq
>         libpq.so.1.0.0 (ELF) => /usr/lib/postgresql/lib/libpq.so.1.0.0
>         libpq.so.1 (ELF) => /usr/lib/postgresql/lib/libpq.so.1
>         libpq.so (ELF) => /usr/lib/postgresql/lib/libpq.so
> linda:/usr/src/postgresql-6.2.1$ 
> 
> 
> 
> but I cannot find any way to make it link to libpq.so.1 instead.
> All the other libraries seem to get linked in that way without any
> special instructions.

You do the right thing. It's libpq.so.1 that is faulty. When you build
it you should give the -Wl,-soname,libpq.so.1 flag to gcc.
Hope this helps...

Ciao.

************************    ____************************************
* Federico Di Gregorio  |  /      *-=$< ;-) TeX Wizard?            *
* Debian developer!     | / -1    pgp: finger fog@perosa.alpcom.it *
* <friend of penguins>  |/        try http://www.debian.org        *
******************DE 9E B2 75 B4 F6 CC 5B  C3 D5 71 51 04 AB F3 B2**


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: