From owner-freebsd-hackers Fri Apr 12 2:12: 1 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from SRDMAIL.SINP.MSU.RU (bigking.sinp.msu.ru [213.131.9.130]) by hub.freebsd.org (Postfix) with ESMTP id C25B137B416 for ; Fri, 12 Apr 2002 02:11:46 -0700 (PDT) Received: from dima (helo=localhost) by SRDMAIL.SINP.MSU.RU with local-esmtp (Exim 3.34 #1) id 16vx4V-000DUT-00 for freebsd-hackers@FreeBSD.org; Fri, 12 Apr 2002 13:10:19 +0400 Date: Fri, 12 Apr 2002 13:10:19 +0400 (MSD) From: Dmitry Mottl To: freebsd-hackers@FreeBSD.org Subject: dynamic libraries Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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