Hi,
None of C++ ANSI standards specifies how internal compiler things should
work (AFAIK). You have no guarantee thet objects are compatible and, what is
more, they aren't.
AFAIK Intel and M$ compilers have compatible static libs. If you want to
have portable code than split it into modules and then build them as native
to OS (i.e. DLL on Windows or SO on Linux).
Better idea is to look at www.wxwindows.org where wxWidgets projects is.
This is a sophisticated and portable framework library for portable
applicatins building. Implements universal GUI that looks always like OS
native GUI as well as other things related to IPC, internet, OpenGL and
more.
--
Roland
----- Original Message -----
From: <eng...@ju...>
To: <dev...@li...>
Sent: Wednesday, June 09, 2004 6:31 AM
Subject: [Dev-C++] C++ Virtual function Tables and Implementation
>
> Greetings,
>
>
> I would like to know if the C++ standard specifys how the virtual fucntion
tables are to implemented by the compiler writers? Also can any tell me if
other languages besides Borland C++ and Borland Delphi have compatible
object binaries?
>
> Example Code:
>
> class InternetConnection {
> public:
> ............virtual int iconnect(...) =0; //Pure Virtual Method
> };
> class DSLConnection : public InternetConnection {
> public:
> ............virtual int iconnect(...); //definition not shown
> };
> class ISDNConnection : public InternetConnection {
> public:
> ............virtual int iconnect(...); //definition not shown
> }
> class DailupConnection : public InternetConnection {
> public:
> ............. virtual int iconnect(...); //definition not shown
> };
> //////////////////////////////////////////////////////////////////////
> ////This class is not derived from InternetConnection
> //////////////////////////////////////////////////////////////////////
> class ExportedConnection {
> public:
> .........virtual int iconnect(...); //definition not shown
> };
>
> InternetConnection can point to a pointer of type ExportedConnection and
execute the virtual functions of that class object. Are there any other
languages that are compatible besides Borland Delphi and Borland C++? I'm
aware that this works also on Unix with C++.
|