* RE: Linking Cygwin & MSVC objects / libraries using MSVC linker
@ 2001-04-24 9:53 Nicholas Peters
2001-04-26 1:03 ` Jesper Eskilson
0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Peters @ 2001-04-24 9:53 UTC (permalink / raw)
To: robert.collins, cygwin
>From: "Robert Collins" <robert.collins@itdomain.com.au>
>To: "Nicholas Peters" <nickapeters@hotmail.com>, <cygwin@cygwin.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@hotmail.com ]
> > Sent: Tuesday, April 24, 2001 10:59 AM
> > To: cygwin@cygwin.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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Linking Cygwin & MSVC objects / libraries using MSVC linker
2001-04-24 9:53 Linking Cygwin & MSVC objects / libraries using MSVC linker Nicholas Peters
@ 2001-04-26 1:03 ` Jesper Eskilson
0 siblings, 0 replies; 4+ messages in thread
From: Jesper Eskilson @ 2001-04-26 1:03 UTC (permalink / raw)
To: Nicholas Peters; +Cc: robert.collins, cygwin
"Nicholas Peters" <nickapeters@hotmail.com> writes:
> I need mostly socket stuff, the link (with MSVC) without libcygwin.a
> produces:
Note that there are no socket-stuff in MSVCRT.*, you need to link with
ws2_32.lib for that. You should be able to resolve most of your socket-calls
with the ones there.
/Jesper
--
-------------------------------------------------------------------------
Jesper Eskilson jojo@virtutech.se
Virtutech http://www.virtutech.se
-------------------------------------------------------------------------
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Linking Cygwin & MSVC objects / libraries using MSVC linker
@ 2001-04-23 18:03 Robert Collins
0 siblings, 0 replies; 4+ messages in thread
From: Robert Collins @ 2001-04-23 18:03 UTC (permalink / raw)
To: Nicholas Peters, cygwin
> -----Original Message-----
> From: Nicholas Peters [ mailto:nickapeters@hotmail.com ]
> Sent: Tuesday, April 24, 2001 10:59 AM
> To: cygwin@cygwin.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?
Rob
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 4+ messages in thread
* Linking Cygwin & MSVC objects / libraries using MSVC linker
@ 2001-04-23 17:59 Nicholas Peters
0 siblings, 0 replies; 4+ messages in thread
From: Nicholas Peters @ 2001-04-23 17:59 UTC (permalink / raw)
To: cygwin
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
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". "
A message in the archives had a similar problem:
http://sources.redhat.com/ml/cygwin/1997-12/msg00071.html
but the author didn't get a reply as far as I can tell, so I thought I'd try
my luck. If you need more info just let me know, any help is appreciated.
Nick Peters
_________________________________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-04-26 1:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-24 9:53 Linking Cygwin & MSVC objects / libraries using MSVC linker Nicholas Peters
2001-04-26 1:03 ` Jesper Eskilson
-- strict thread matches above, loose matches on Subject: below --
2001-04-23 18:03 Robert Collins
2001-04-23 17:59 Nicholas Peters
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).