Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Apr 2002 13:10:19 +0400 (MSD)
From:      Dmitry Mottl <dima@sinp.msu.ru>
To:        freebsd-hackers@FreeBSD.org
Subject:   dynamic libraries
Message-ID:  <Pine.BSF.4.43.0204121308470.4449-100000@BigKing.sinp.msu.ru>

next in thread | raw e-mail | index | archive | help
Hi,
sorry, for possible offtopic, but freebsd-question said nothing

How can I link C program with different versions of the same library?

# /sbin/ldconfig -r | grep ncurses
    5:-lncurses.5 => /usr/lib/libncurses.so.5
    84:-lncurses.3 => /usr/lib/compat/libncurses.so.3
# gcc test.c -lncurses
# ldd a.out
a.out:
    libncurses.so.5 => /usr/lib/libncurses.so.5 (0x28065000)
    libc.so.4 => /usr/lib/libc.so.4 (0x280a7000)


But if I explicitly set version of library:
# gcc test.c -lncurses.5
/usr/libexec/elf/ld: cannot find -lncurses.5

or
# gcc test.c -lncurses.3
/usr/libexec/elf/ld: cannot find -lncurses.3

I have an error. Why?


- Dmitry


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.43.0204121308470.4449-100000>