This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problems linking g++-generated win32 dlls with VC++ applications

Marat Boshernitsan <maratb@cs.Berkeley.EDU> writes:
> A minor follow up...
> Marat Boshernitsan <> 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[1] 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. 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]