From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26369 invoked by alias); 21 Oct 2005 23:08:36 -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 26198 invoked by uid 22791); 21 Oct 2005 23:08:30 -0000 Received: from dessent.net (HELO dessent.net) (69.60.119.225) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 21 Oct 2005 23:08:30 +0000 Received: from localhost ([127.0.0.1] helo=dessent.net) by dessent.net with esmtp (Exim 4.52) id 1ET5zr-0004GG-Gx for gcc-help@gcc.gnu.org; Fri, 21 Oct 2005 23:08:24 +0000 Message-ID: <435974E7.86A4D7AB@dessent.net> Date: Fri, 21 Oct 2005 23:08:00 -0000 From: Brian Dessent MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: link error References: <7adf9af0510211322q39d3a0eag@mail.gmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2005-10/txt/msg00134.txt.bz2 Moon Hwang wrote: > I make my own library using this makefile. You might consider using automake and libtool, which takes care of all this for you. > SONAME := lib$(TARGET)$(MODI).so .so is not the universal extension for shared libraries. Under windows (and Cygwin) it's .dll, under darwin it's .dylib, and so on. You really shouldn't hardcode this information and expect to have a portable makefile. Under Cygwin the normal convention is that for a library named "foo" the shared library is cygfoo.dll and the import libray is libfoo.dll.a. If it is a versioned library then it is cygfoo-n.dll and libfoo-n.dll.a. > g++ -I /usr/X11R6/include -I ../../../Include -I > /usr/local/include/boost_1_32_0 -L /usr/X11R6/lib -L > /home/MHHwang/lib/Release Bomb.cpp -o Bomb -lxyDEVS -lpthread > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: > cannot find -lxyDEVS > collect2: ld returned 1 exit status Under Cygwin, when you specify -lxyDEVS, the linker will search for the following filenames (in this order): libxyDEVS.dll.a xyDEVS.dll.a libxyDEVS.a cygxyDEVS.dll libxyDEVS.dll xyDEVS.dll (As documented at .) So of course it errors because .so is not tne correct extension under Cygwin. You can still link against a .so file but you will probably have to specify its full filename like with other link objects, as opposed to -lfoo. Brian