From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32441 invoked by alias); 13 Dec 2004 15:30:03 -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 32015 invoked from network); 13 Dec 2004 15:29:47 -0000 Received: from unknown (HELO smtp.irisa.fr) (131.254.254.26) by sourceware.org with SMTP; 13 Dec 2004 15:29:47 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id C545FFABC for ; Mon, 13 Dec 2004 16:29:46 +0100 (CET) Received: from smtp.irisa.fr ([131.254.254.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30193-01 for ; Mon, 13 Dec 2004 16:29:46 +0100 (CET) Received: from paraletage.irisa.fr (paraletage.irisa.fr [131.254.13.63]) by smtp.irisa.fr (Postfix) with SMTP id 44A8FFAB4 for ; Mon, 13 Dec 2004 16:29:46 +0100 (CET) Date: Mon, 13 Dec 2004 15:30:00 -0000 From: Olivier Rochecouste To: gcc-help@gcc.gnu.org Subject: Re: Dynamic Linking Library Problem Using GCC Message-Id: <20041213162946.65786257@paraletage.irisa.fr> In-Reply-To: <20041213151751.64879.qmail@web60703.mail.yahoo.com> References: <20041213151751.64879.qmail@web60703.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg00117.txt.bz2 Hi Cheok, I'm not an expert but I think you should make a symlink to your shared library: "ln -s libmean.so.1.0.1 libmean.so" ld should be able to find the .so now -- Olivier > Hi, > > I read through the tutorial > http://www.adp-gmbh.ch/cpp/gcc/create_lib.html in > buidling dynamic library using gcc. It is interesting. > However, after following the steps inside the > tutorial, it doesn't work in my system. > > Here is the sequence of steps which I had performed: > > [yccheok@localhost project]$ ls -al > total 28 > drwxrwxr-x 2 yccheok yccheok 4096 Dec 13 01:16 . > drwx------ 65 yccheok yccheok 12288 Dec 13 00:58 .. > -rw-rw-r-- 1 yccheok yccheok 56 Dec 13 00:48 > calc_mean.c > -rw-rw-r-- 1 yccheok yccheok 29 Dec 13 00:48 > calc_mean.h > -rw-rw-r-- 1 yccheok yccheok 224 Dec 13 00:49 > main.c > [yccheok@localhost project]$ gcc -c -fPIC calc_mean.c > -o calc_mean.o > [yccheok@localhost project]$ gcc -shared > -Wl,-soname,libmean.so.1 -o > libmean.so.1.0.1 calc_mean.o > [yccheok@localhost project]$ gcc main.c -o > dynamically_linked -L. -lmean > /usr/bin/ld: cannot find -lmean > collect2: ld returned 1 exit status > [yccheok@localhost project]$ ls -al > total 40 > drwxrwxr-x 2 yccheok yccheok 4096 Dec 13 01:17 . > drwx------ 65 yccheok yccheok 12288 Dec 13 00:58 .. > -rw-rw-r-- 1 yccheok yccheok 56 Dec 13 00:48 > calc_mean.c > -rw-rw-r-- 1 yccheok yccheok 29 Dec 13 00:48 > calc_mean.h > -rw-rw-r-- 1 yccheok yccheok 908 Dec 13 01:16 > calc_mean.o > -rwxrwxr-x 1 yccheok yccheok 4349 Dec 13 01:16 > libmean.so.1.0.1 > -rw-rw-r-- 1 yccheok yccheok 224 Dec 13 00:49 > main.c > [yccheok@localhost project]$ > > Can you please advice on why the ld cannot find the > mean library. Do I need to prior perform anything with > ldconfig before i dynamic linked my main application > with the mean library? > > Thank you! > > -cheok > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >