From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32651 invoked by alias); 11 Feb 2002 17:13:23 -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 32566 invoked from network); 11 Feb 2002 17:13:19 -0000 Received: from unknown (HELO ariel.eastgw.xerox.com) (208.140.33.25) by sources.redhat.com with SMTP; 11 Feb 2002 17:13:19 -0000 Received: from sdi-adm1.sdi.xcdg.xerox.com (sdi-adm1.sdi.xcdg.xerox.com [13.231.36.100]) by ariel.eastgw.xerox.com (8.9.3/8.9.3) with ESMTP id MAA04369; Mon, 11 Feb 2002 12:13:09 -0500 (EST) Received: by sdi-adm1.sdi.xcdg.xerox.com with Internet Mail Service (5.5.2654.89) id ; Mon, 11 Feb 2002 12:13:17 -0500 Message-ID: <8229C4577A00D511ABC00090277A45A0ADBA20@us0111-ch-ms1.channels.mc.xerox.com> From: "Venkatakrishnan, V" To: "'Andrea 'Fyre Wyzard' Bocci'" , gcc-help@gcc.gnu.org Subject: RE: A simple problem regarding shared libs... Date: Mon, 11 Feb 2002 09:38:00 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2654.89) Content-Type: text/plain X-SW-Source: 2002-02/txt/msg00110.txt.bz2 Hi Andrea, Thanks for the effort, but I still can't get it to work here. It seems that the linker goes looking only for .a files and doesn't even see the .so in my directory. I was Googling around regarding this and came across http://oss.software.ibm.com/pipermail/icu/2001-November/004012.html, take a look. I tried the -brtl switch but got a few more errors saying cannot find libgcc.a. I'm not too familiar with this switch or what it does, from the way things are going it basically seems that my linker is only looking for .a files and ignores .so (coz. I can get it to link using a static library), is there a way I can tell it look for .so files as well?? Regards, Venky -----Original Message----- From: Andrea 'Fyre Wyzard' Bocci [mailto:fwyzard@inwind.it] Sent: Friday, February 08, 2002 8:36 PM To: Venkatakrishnan, V; gcc-help@gcc.gnu.org Subject: Re: A simple problem regarding shared libs... 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