Re: Export C++ class from a Borland DLL and use it in Microsoft VC
- From: "Bruno van Dooren [MVP VC++]" <bruno_nos_pam_van_dooren@xxxxxxxxxxx>
- Date: Fri, 29 Sep 2006 16:36:06 +0200
I'm new of this group and I do not know if this is the correct group
for my question.
I have a DLL with its export library (.lib) wrote in Borland C++ 6. In
borland everything is OK and I am able to include the lib and use the
class that i have exported creating an instance with new etc... I
would like to export this class in microsoft VC++ using the same .lib
file. Obviously it doesn' t work.
Is it possible to generate or convert the import library into a
compatible format?
Nope.
There is no binary standard for compiled C++ code. Each compiler uses its
own binary layout.
This means that C++ code is incompatible between different compilers, and
even different compiler version.
Using Borland C++ dlls in msvc is not possible.
I think, that's not true. For example, I use a DLL written in Intel
Fortran with Borland C++. IMHO DLL-usage is compiler - and even though -
language independant. If it really doesn't work with the MS compiler (I
did not do this), it is in fact a Microsoft problem.
Not true.
The question is clearly about C++ classes that are exported from a dll.
Of course, dlls can be created with any C/C++ compiler.
But compiled C++ classes are NOT compatible between different C++ compilers.
This has nothing to do with Microsoft. It is a result from the fact that it
took a very long time for C++ to be standardized, while different vendors
went along, doing their own thing.
Borland is incompatible with microsoft is incompatible with gcc is
incompatible with icc is incompatible with ... as far as C++ classes are
concerned.
DLL usage itself is no problem. The problem is that what's inside that dll
is not a class as msvc would have compiled it.
Hence, it does not work.
--
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@xxxxxxxxxxx
Remove only "_nos_pam"
.
- References:
- Export C++ class from a Borland DLL and use it in Microsoft VC
- From: Fabry
- Re: Export C++ class from a Borland DLL and use it in Microsoft VC
- From: Bruno van Dooren [MVP VC++]
- Re: Export C++ class from a Borland DLL and use it in Microsoft VC
- From: Markus Donath
- Export C++ class from a Borland DLL and use it in Microsoft VC
- Prev by Date: Re: reading in a file
- Next by Date: Re: unable to locate MSVCP80D.dll
- Previous by thread: Re: Export C++ class from a Borland DLL and use it in Microsoft VC
- Next by thread: Re: Export C++ class from a Borland DLL and use it in Microsoft VC
- Index(es):
Relevant Pages
|