delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/21/19:09:10

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
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3C758BFA.2A1537AF@etr-usa.com>
Date: Thu, 21 Feb 2002 17:08:26 -0700
From: Warren Young <warren AT etr-usa DOT com>
Organization: -ENOENT
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Cygwin-L <cygwin AT cygwin DOT com>
Subject: Re: DLLs that can be used with MS C++
References: <OFCA799A05 DOT E3C41A9B-ONC1256B67 DOT 002F9BD9 AT sto DOT se DOT ibm DOT com>

Dan Kyhl wrote:
> 
> Are you saying that I can't make C++ dll's in cygwin for use in 'normal'
> Windows?

No, because every C++ compiler "mangles" identifiers differently.  Name
mangling is considered by many to be a feature.  Even your own company's
C++ compilers probably mangle names differently from VC++ and g++.  They
may even mangle names differently from _each other_.

Now, if you're not trying to call methods, but instead calling plain ol'
functions that don't take objects or pointers to objects as parameters,
you can prefix the functions with 'extern "C"' and it will export those
names unmangled.  Such functions can use objects internally, but you
can't pass them in and out because object layout might be different
between your two compilers.

> There's not even a native gcc for Windows?

mingw qualifies, but the name mangling issue still pertains, since
underneath it's still g++.  This is not a "Windows" issue, it's a
compiler issue.  Other native Windows compilers -- including IBM
VisualAge -- don't interoperate with each other at the C++ level.

This is one reason why COM, .NET and Java exist.  They define a single
object model so cross-language and cross-tool calls work right.  It's
also why there is no C++ API for Windows.

This is getting pretty far afield from Cygwin, though.  If you want to
take it up further, you should probably go to comp.lang.c++{.std} or
reply by private email.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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