Subject: Re: MSVC linker
From: [email-masked] ("Paul J. Metzger")

7 Jul 1997 15:46:36 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: root <[email-masked]>
Original-cc: [email-masked]
In-Reply-To: <[email-masked]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Original-Sender: [email-masked]

Jacob,

> What means for you linking MSVC code with cygnus code?
> 
> When you write your hello world program, you suppose that
> the startup code has already initialized stdio and stderr, and all
> that for you isn't it?
> 
> Well, this is done generally in the startup code that is called by the
> system. That code will initialize those variables (and do some other
> things) and THEN call _mainb,or _WinMain, or whatever the user entry
> point is.
> 
> This is the reason you do not see anything when you try your
> hello world program.
> 
> Question:
> You want to use cygnu's or MSVC startup?
> Related question:
> You will use the cygnus or the MSVC version of 'printf'?

My ultimate objective is to link existing .lib files compiled with
MSVC with Unix code ported to NT via the GNU Win32 environment.  It
doesn't matter to me if the startup code is cygnus or MSVC.  Likewise,
it doesn't matter whose 'printf' (and similar functions) I use.

> Normally, linking objects of two diferent compiler systems will seldom
> work unless both compilers are binary compatible and run time
> library compatible. This is NEVER possible when using C++ due to
> name mangling. This is seldom possible in C due to library differences.

I understand the issue about C++ as well as the general issues about
compiler differences.  As others have commented, the FAQ for the Cygnus
stuff clearly indicates that it's possible to have code from the two
environments co-exist.  Obviously somebody must have figured out how
to get something running, and I'm just trying to do the same.  I'll try
to patch to 'gas' to see if that helps.

> You would have more chances with the minimalist version of gcc
> or with lcc.

Unless I'm mistaken, both of these options lose the Unix emulation
layer, which I need for the libraries I'm trying to port.

						- Paul

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Reality by Design, Inc.                      Tel:  (617) 942-0440
 95 Main Street, Suite 3                      Fax:  (617) 944-6209
 Reading, MA  01867-3965                      URL:  www.rbd.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".