This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: .dll question
- From: Dan Kegel <dank at kegel dot com>
- To: David Starks-Browning <david at starks-browning dot com>
- Cc: cygwin at cygwin dot com
- Date: Sun, 20 Apr 2003 07:27:39 -0700
- Subject: Re: .dll question
- References: <3D9B1B11.16005.3D0BDC@localhost> <1033600781.14524.221.camel@lifelesswks> <8041-Sun20Apr2003145627+0100-david@starks-browning.com>
David Starks-Browning wrote:
On a related note, can Cygwin generate c++ .dlls which are loadable by msvc++ or
does Microsofts' method of name mangling prohibit such things?
No it can't. In general, C++ compilers don't interoperate. The C++-Lite
FAQ has a section on this.
From memory, the issues are:
*name mangling
*VMT layout
*new[] management
*exception handling
If you want to use cygwin C++ from MSVC, write some C bindings for the
code.
... All the FAQ says about this is the following:
Q. Can I mix objects compiled with msvc++ and gcc?
A. Yes, but only if you are combining C object files. MSVC C++ uses
a different mangling scheme than GNU C++, so you will have
difficulties combining C++ objects.
I'd like to include the extra detail that Robert goes into, if it's
correct. Does anyone know for sure?
Any discussion of these issues isn't complete without mentioning
the fact that you can't even mix objects compiled by gcc2.x
and gcc3.x. This was caused by the switchover as of gcc3.x to the standard
C++ ABI defined at http://www.codesourcery.com/cxx-abi/
That document defines very carefully all the issues Robert writes
about, I think. All C++ compilers for Linux should now be following
that standard. See also http://gcc.gnu.org/gcc-3.2/c++-abi.html
Also, I have some extra detail about name mangling in MSVC6 and gcc2.x
at http://www.kegel.com/mangle.html
It's three years old but may still be useful.
- Dan
--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
--
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/