delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/03/20:42:14

X-Spam-Check-By: sourceware.org
Message-ID: <4392496F.EADA482A@dessent.net>
Date: Sat, 03 Dec 2005 17:42:07 -0800
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: gzread, gzdopen, gzclose not found
References: <BAY104-F375B56A79F82A8F3A31DDEAD4E0 AT phx DOT gbl>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Robert Body wrote:

> I have been asking on the clanlib mailing list... waiting... asking other
> questions... looking on internet, mailing list archives... from the last
> email which you might not have seen prior to your reply, I found  this
> 
> Libs/libclanApp.so.$(D_VERSION_MINOR) $(OBJF_LIB_App) -L Libs -lz -lclanCore
>         @ln -s -f libclanApp.so.$(D_VERSION_MINOR)
> Libs/libclanApp.so.$(D_VERSION_MAJOR)
>         @ln -s -f libclanApp.so.$(D_VERSION_MAJOR) Libs/libclanApp.so
> 
> and now i just put the -lz there, but it's not the right spot
> and I don't know what a right spot is, and why is "-lz" enough? i would
> think to put /usr/lib somewhere

/usr/lib is searched by default.  All you need is -lfoo if the import
library /usr/lib/libfoo.a (or .dll.a) exists.

You're probably going to have a lot more to do than just add -lz
though.  All of that stuff in the makefile that you've pasted is
linux-specific and won't work under Cygwin.  Under cygwin:

- shared libraries have extension .DLL not .so
- shared libraries have the prefix "cyg" not "lib"
- shared libraries must be versioned as cygfoo-n.dll not libfoo.so.x.y
- shared libraries cannot be symlinked
- flags such as -rpath and -soname are meaningless
- shared libraries are installed in /usr/bin, not /usr/lib (with the
import library in /usr/lib so that the normal -lfoo lookup still works)
- shared libraries cannot have undefined symbols at link time, as there
is no "lazy" linking as on linux.  This means on linux if you screw up
the order of -lfoo or omit -lfoo it's no big deal since it can be
resolved at runtime, but this is not the case under win32.

In short, the makefile you have is just not portable because it assumes
linux.  This is precisely why libtool exists, to abstract away all this
stuff so that the software builds everywhere, regardless of all these
sorts of differences.  From the fact that you've posted on their mailing
list with no reply would seem to imply that they are simply linux
zealots and don't care about portability to any other system, so telling
them they should use libtool will probably have no effect.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019