delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/24/13:39:02

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Originating-IP: [131.120.98.43]
From: "Nicholas Peters" <nickapeters AT hotmail DOT com>
To: robert DOT collins AT itdomain DOT com DOT au, cygwin AT cygwin DOT com
Subject: RE: Linking Cygwin & MSVC objects / libraries using MSVC linker
Date: Tue, 24 Apr 2001 11:53:31 -0500
Mime-Version: 1.0
Message-ID: <F196kBbKP7Ie8tlMazU00008065@hotmail.com>
X-OriginalArrivalTime: 24 Apr 2001 16:53:32.0028 (UTC) FILETIME=[181693C0:01C0CCDF]



>From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
>To: "Nicholas Peters" <nickapeters AT hotmail DOT com>, <cygwin AT cygwin DOT com>
>Subject: RE: Linking Cygwin & MSVC objects / libraries using MSVC linker
>Date: Tue, 24 Apr 2001 10:55:15 +1000
>
> > -----Original Message-----
> > From: Nicholas Peters [mailto:nickapeters AT hotmail DOT com]
> > Sent: Tuesday, April 24, 2001 10:59 AM
> > To: cygwin AT cygwin DOT com
> > Subject: Linking Cygwin & MSVC objects / libraries using MSVC linker
> >
> >
> > Is it possible to link Cygwin compiled objects and Microsoft
> > Visual C (not
> > C++) objects using the libcygwin.a and it's associated libraries  and
> > Microsofts various libraries (MSVCRT, etc).  I would very
> > much like to use
>
>lybcygwin.a is mainly an import lib for cygwin1.dll aka libm aka libc
>aka lpthread aka I'm not shure howmanyotherlibraries.
>
> > the MSVC linker for this (not ld) but am open to all ideas.
> > When I tried
> > to just flat out link (with MSVC linker) I got some errors
> > from libcygwin.a
> > stating it had undefined external references to data_start, data_end,
> > bss_start, bss_end.  After reading through some of the mail
> > archives for
> > this list I decided to throw in some null char declarations for those
> > references since I'm not using the fork functionality of
> > libcygwin.  I get
> > two warnings in the link, and the resulting exe crashes.
> >
> > The warnings are:
> > libcygwin.a : warning multiple ".idata" sections found with different
> > attributes.
> >
> > libcygwin.a : warning __fmode already defined in MSVCRT.LIB second
> > definition ignored.
> >
> > When I list libcygwin.a BEFORE MSVCRT in my link command
> > line, the second
> > warning changes to:
> >
> > MSVCRT.LIB : warning _atexit already defined in libcygwin.a second
> > definition ignored.
> >
> > Either way the the produced executable crashes with "The
> > instruction at
> > <address> referenced memory at <address>.  The memory could
> > not be "read". "
>
>AFAIK you cannot mix MSVCRT.LIB and libcygwin.a. They implement the same
>functions. What do you need from cygwin?

   I need mostly socket stuff, the link (with MSVC) without libcygwin.a 
produces:

: error LNK2001: unresolved external symbol _gethostname
: error LNK2001: unresolved external symbol _sleep
: error LNK2001: unresolved external symbol __imp___ctype_
: error LNK2001: unresolved external symbol _accept
: error LNK2001: unresolved external symbol _select
: error LNK2001: unresolved external symbol _listen
: error LNK2001: unresolved external symbol _bind
: error LNK2001: unresolved external symbol _setsockopt
: error LNK2001: unresolved external symbol _socket
: error LNK2001: unresolved external symbol _htons
: error LNK2001: unresolved external symbol _getservbyname
: error LNK2001: unresolved external symbol __impure_ptr
: error LNK2001: unresolved external symbol __impure_ptr

   From previous experience I believe I can safely ignore the impure_ptr 
errors (by forcing the link with /FORCE), and if you know what libraries to 
strip out of libcygwin to get the above symbols taken care of that would be 
great.  Thanks for responding.

                                           Nick
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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