From owner-freebsd-questions Thu Feb 29 20:15:40 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA11880 for questions-outgoing; Thu, 29 Feb 1996 20:15:40 -0800 (PST) Received: from ccslinux.dlsu.edu.ph (csckhg@[165.220.8.15]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id UAA11383 for ; Thu, 29 Feb 1996 20:05:14 -0800 (PST) Received: (from humprey@localhost) by ccslinux.dlsu.edu.ph (8.6.12/8.6.9) id BAA19712; Fri, 1 Mar 1996 01:44:26 +0800 Date: Fri, 1 Mar 1996 01:44:26 +0800 (GMT+0800) From: "Humprey C. Sy" To: questions@freebsd.org Subject: Compiling with shared libraries Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk I'm confused about how shared libraries actually work. Here's my problem: I was able to make a shared library file - libmac.a. What I'm confused about is how come if I have to compile it together with my c program, I have to place the option "-lmac" at the end of the command. i.e. cc -O2 zo.c -lmac If I try to include "-lmac" before zo.c, the procedures compiled in libmac.a won't be seen at all, and the compiler returns errors saying these procedures are unreferenced from text segment. Why is this so? Any clarifications would be greatly appreciated. Thank you very much! - Humprey -