From owner-freebsd-questions Sun Apr 7 1:11:42 2002 Delivered-To: freebsd-questions@freebsd.org Received: from SRDMAIL.SINP.MSU.RU (bigking.sinp.msu.ru [213.131.9.130]) by hub.freebsd.org (Postfix) with ESMTP id E92A437B416 for ; Sun, 7 Apr 2002 01:11:39 -0800 (PST) Received: from dima (helo=localhost) by SRDMAIL.SINP.MSU.RU with local-esmtp (Exim 3.34 #1) id 16u8hO-000NEq-00 for freebsd-questions@FreeBSD.org; Sun, 07 Apr 2002 13:10:58 +0400 Date: Sun, 7 Apr 2002 13:10:58 +0400 (MSD) From: Dmitry Mottl To: freebsd-questions@FreeBSD.org Subject: dynamic libraries Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, 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-questions" in the body of the message