From owner-freebsd-questions Wed Jul 28 12:35: 9 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mc-qout4.whowhere.com (mc-qout4.whowhere.com [209.185.123.18]) by hub.freebsd.org (Postfix) with SMTP id 64554155AE for ; Wed, 28 Jul 1999 12:35:03 -0700 (PDT) (envelope-from ifsmgr@my-deja.com) Received: from Unknown/Local ([?.?.?.?]) by my-deja.com; Wed Jul 28 12:34:58 1999 To: freebsd-questions@freebsd.org Date: Wed, 28 Jul 1999 12:34:58 -0700 From: " " Message-ID: Mime-Version: 1.0 Cc: X-Sent-Mail: off Reply-To: X-Mailer: MailCity Service Subject: Problem using shared library X-Sender-Ip: 38.229.41.237 Organization: My Deja Email (http://www.my-deja.com:80) Content-Type: text/plain; charset=us-ascii Content-Length: 1529 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello everybody, I'm new to FreeBSD programming and I need to port some Windows software that is built of DLLs. As I couldn't find a shared library sample in /usr/share/examples, I chose, quite arbitrary, the ppp/PAM relationship to be my starting point. After reading both of them, I cooked something like this. FreeBSD 3.2 from CD-ROM -------- I have the following makefile for my library: LIB= my_lib SHLIB_NAME= my_lib.so SRCS= my_lib.c CFLAGS+= -Wall DPADD+= ${LIBGCC_PIC} LDADD+= -lgcc_pic .include Make creates my_lib.so in the current directory. I copy it to the /usr/lib directory and rename to libmy_lib.so -------- I have the following makefile for my program: PROG= my_prog SRCS= my_prog.c #LDADD= -lcrypt -lutil -lmd LDADD= -lmy_lib .include Make produces the following output: Warning: Object directory not changed from original /usr/home/stan/server cc -O -pipe -c my_prog.c cc -O -pipe -o my_prog.o -lmy_lib make: don't know how to make my_prog.1. Stop and creates executable my_prog. -------- Then, when I run my_prog, it prints: /usr/libexec/ld-elf.so.1: Shared object "my_lib.so" not found If I then rename /usr/lib/libmy_lib.so to my_lib.so, it finally finds the library and runs as expected. What I'm doing wrong? Thank you. --== Sent via Deja.com http://www.deja.com/ ==-- Share what you know. Learn what you don't. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message