From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6298 invoked by alias); 8 Feb 2002 18:20: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 6240 invoked from network); 8 Feb 2002 18:20:39 -0000 Received: from unknown (HELO ariel.eastgw.xerox.com) (208.140.33.25) by sources.redhat.com with SMTP; 8 Feb 2002 18:20:39 -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 NAA15130; Fri, 8 Feb 2002 13:20:26 -0500 (EST) Received: by sdi-adm1.sdi.xcdg.xerox.com with Internet Mail Service (5.5.2654.89) id ; Fri, 8 Feb 2002 13:20:33 -0500 Message-ID: <8229C4577A00D511ABC00090277A45A0ADBA0E@us0111-ch-ms1.channels.mc.xerox.com> From: "Venkatakrishnan, V" To: "'John Love-Jensen'" , gcc-help@gcc.gnu.org Subject: RE: A simple problem regarding shared libs... Date: Fri, 08 Feb 2002 10:20: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/msg00090.txt.bz2 Hi Eljay, Hmmmm, I did echo $LD_LIBRARY_PATH and I didn't get anything (just got my # prompt back) and then did set LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH, did echo again and didn't get anything, could it mean that my variable is not set? I tried gcc hello.o -L. -lshared -o Hello again after that but got the same error message. Regards, Venky -----Original Message----- From: John Love-Jensen [mailto:eljay@adobe.com] Sent: Friday, February 08, 2002 12:49 PM To: Venkatakrishnan, V; gcc-help@gcc.gnu.org Subject: Re: A simple problem regarding shared libs... Hi V, Have you set your LD_LIBRARY_PATH? LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH Sincerely, --Eljay Hi, I've these two files..... Hello.c #include Extern const char* func(); Int main( void) { printf("Hello World"); func() return 1; } Shrobj.c Const char* func(void) { printf("Hello from shared lib"); } I do the following to create the obj files.. Gcc -c hello.c Gcc -c shrobj.c and then to create the shared lib I do Gcc shrobj.o -shared -o libshared.so this gives me the shared lib. Now I try to compile my program hello.o with this shared lib by saying Gcc hello.o -L. -lshared -o Hello but this gives me an error saying..... Ld: 0706-006 Cannot find or open library file: -l shared ld:open(): A file or directory in the path name does not exist. Collect2: ld returned 255 exit status Why is this happening? My shared lib. Is right there and I've also given -L. to look for it in the current directory. Any help please. Regards,