delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/13/13:43:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <029701c361c2$c53e9af0$6401a8c0@jag750>
From: "Jag" <Jagjit AT ntlworld DOT com>
To: <cygwin AT cygwin DOT com>
References: <007d01c36189$acf99f00$6401a8c0 AT jag750> <180-2040467307 DOT 20030813150824 AT familiehaase DOT de>
Subject: Re: help for a newbie C Programmer
Date: Wed, 13 Aug 2003 18:46:02 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300

Hi Gerrit,

I tried that, but I am still getting the following error.

$ gcc -shared -o
libbridge.dll -Wl,--out-implib=libbridge.dll.a -Wl,--export-al
l-symbols -Wl,--enable-auto-import -Wl,--whole-archive bridge.o nwutil.o
jagsoc
ket.o     -Wl,--no-whole-archive
Creating library file: libbridge.dll.a
nwutil.o(.text+0x57):nwutil.c: undefined reference to `_h_nerr'
nwutil.o(.text+0x63):nwutil.c: undefined reference to `_h_errlist'
collect2: ld returned 1 exit status

Any idea what package is h_nerr and h_errlist are defined in?

Jag
----- Original Message -----
From: "Gerrit P. Haase" <gp AT familiehaase DOT de>
To: "Jag" <Jagjit AT ntlworld DOT com>
Cc: <cygwin AT cygwin DOT com>
Sent: Wednesday, August 13, 2003 2:08 PM
Subject: Re: help for a newbie C Programmer


> Hallo Jag,
>
> Am Mittwoch, 13. August 2003 um 12:57 schriebst du:
>
> > Hi,
>
> > I am trying to port some socket code from AIX onto unix.
>
> > When I try to link the code I get ' ld: cannot find -lsocket'
>
> > The line being executed is :
>
> > ld -dy -G -o libbridge.so bridge.o nwutil.o
> > jagsocket.o -Bstatic -lc -lsocket -lnsl
>
> > I have searched for socket.a and nsl.a in the cygwin directory but they
> > aren't there.
> > The makefile works on AIX and I was hoping it would be a straight
forward
> > compilation on windows 2k.
>
> > Can anyone please point me in the right direction !
>
> Use gcc to link. libc, libsocket and libnsl are all included in
> libcygwin which you don't need to propagate to the linker:
>
> gcc -shared -o libbridge.dll \
>     -Wl,--out-implib=libbridge.dll.a \
>     -Wl,--export-all-symbols \
>     -Wl,--enable-auto-import \
>     -Wl,--whole-archive \
>     bridge.o nwutil.o jagsocket.o \
>     -Wl,--no-whole-archive \
>     ${dependency_libs}
>
> where ${dependency_libs} may be any libraries your library is
> depending on (like -lstdc++ for C++ libraries).
>
> -Wl,--out-implib=libbridge.dll.a results in the import library which
> you can use to link your application against (with -L/path -lbridge).
>
>
> Gerrit
> --
> =^..^=
>
>
> --
> 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/
>
>


--
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