From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26348 invoked by alias); 9 Feb 2002 01:33:40 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 26101 invoked from network); 9 Feb 2002 01:33:35 -0000 Received: from unknown (HELO mailrelay1.inwind.it) (212.141.54.101) by sources.redhat.com with SMTP; 9 Feb 2002 01:33:35 -0000 Received: from quigonn.inwind.it (62.98.58.66) by mailrelay1.inwind.it (5.5.053) id 3C5E8B2800308C46; Sat, 9 Feb 2002 02:32:55 +0100 Message-Id: <5.1.0.14.0.20020209022837.02b9eec8@popmail.inwind.it> X-Sender: fwyzard@popmail.inwind.it X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 08 Feb 2002 18:49:00 -0000 To: "Venkatakrishnan, V" , gcc-help@gcc.gnu.org From: Andrea 'Fyre Wyzard' Bocci Subject: Re: A simple problem regarding shared libs... In-Reply-To: <8229C4577A00D511ABC00090277A45A0ADBA0D@us0111-ch-ms1.chann els.mc.xerox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-SW-Source: 2002-02/txt/msg00100.txt.bz2 Hi I've tried reproducing your problem, but on my machine everything went smoothly. Also, I've not set LD_LIBRARY_PATH in any way. Just typed, and it worked ! (gcc 2.96 and gcc 3.0.2, binutils 2.11.90, linux 2.4.7, RedHat 7.2) [fwyzard@stufis06 test]$ gcc sharobj.c -c -o sharobj.o [fwyzard@stufis06 test]$ gcc hello.c -c -o hello.o [fwyzard@stufis06 test]$ gcc sharobj.o -shared -o libshared.so [fwyzard@stufis06 test]$ gcc hello.o -L. -lshared -o hello [fwyzard@stufis06 test]$ ./hello Hello World Hello from shared lib Here's the files I've used: /* hello.c */ #include extern const char* func(); int main( void) { printf("Hello World\n"); func(); return 1; } /* end of hello.c */ /* sharobj.c */ #include const char* func(void) { printf("Hello from shared lib\n"); } /* end of sharobj.c */ fwyzard