This is the mail archive of the
mailing list for the GCC project.
Re: problems linking g++-generated win32 dlls with VC++ applications
- To: Marat Boshernitsan <maratb at cs dot berkeley dot edu>
- Subject: Re: problems linking g++-generated win32 dlls with VC++ applications
- From: Mumit Khan <khan at NanoTech dot Wisc dot EDU>
- Date: Wed, 03 May 2000 10:11:49 -0500
- cc: gcc at gcc dot gnu dot org, abegel at cs dot berkeley dot edu
Marat Boshernitsan <maratb@cs.Berkeley.EDU> writes:
> A minor follow up...
> Marat Boshernitsan <email@example.com> writes:
> > > Sorry, but g++ and VC++ do not share compatible ABI, and are not link
> > > compatible at C++ object (.o or .dll or .a or anything that's been
> > > compiled) level. This situation is not unique to g++ on Windows32 --
> > > the same is currently true for example for Sun C++ and g++ under
> > > SunOS/Solaris, HP C++ and g++ under HP-UX, SGI C++ and g++ under
> > > IRIX, and so on.
> > Hmm, okay, I sort of expected this. But the ABI is compatible at the C
> > level, right?
> I just discovered that C-level compatibility only works if I compile the
> dll for mingw32 target, i.e. remove all dependence on cygwin.dll and use
> MS C runtime...
> So, with that in mind, is it possible to do what I want?
Ah, I missed the fact that you were indeed using extern "C" linkage. I
also missed your posting to Cygwin list, and it is indeed a Cygwin issue
rather than a gcc issue.
There are definitely problems with linking to a DLL that was compiled with
a "competing" runtime such as MSVC (if your DLL only depended on Win32 API
then it would work), but you should be able to dynamically load it. If you
can send me a short testcase, I'll take a look at it. You can send it
directly to me or to the Cygwin mailing list.