From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19608 invoked by alias); 8 Feb 2002 17:30:38 -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 19480 invoked from network); 8 Feb 2002 17:30:22 -0000 Received: from unknown (HELO ariel.eastgw.xerox.com) (208.140.33.25) by sources.redhat.com with SMTP; 8 Feb 2002 17:30:22 -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 MAA07883 for ; Fri, 8 Feb 2002 12:30:14 -0500 (EST) Received: by sdi-adm1.sdi.xcdg.xerox.com with Internet Mail Service (5.5.2654.89) id ; Fri, 8 Feb 2002 12:30:21 -0500 Message-ID: <8229C4577A00D511ABC00090277A45A0ADBA0D@us0111-ch-ms1.channels.mc.xerox.com> From: "Venkatakrishnan, V" To: gcc-help@gcc.gnu.org Subject: A simple problem regarding shared libs... Date: Fri, 08 Feb 2002 09:30: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/msg00088.txt.bz2 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,