Portable C++

  • Thread starter Thread starter Andrew Roberts
  • Start date Start date
A

Andrew Roberts

Could anyone recommend to me any good books or online articles that contain
in depth coverage of portable C++ development? Specifically writing binary
compatible C++ interfaces and code that will work and be fully compatible
where code built under multiple versions of the compiler/runtime are being
used in the same process. Exceptions are being thrown over module
boundaries.

Currently the system is deployed on Windows and components built with VC8, 7
and 6 are all used within the same process, due to efforts by Microsoft to
make their compilers/runtimes compatible this just works, will this continue
to be the case if the system is built for say Linux and several versions of
the compiler are mixed?
 
Could anyone recommend to me any good books or online articles that
contain in depth coverage of portable C++ development? Specifically
writing binary compatible C++ interfaces and code that will work and be
fully compatible where code built under multiple versions of the
compiler/runtime are being used in the same process. Exceptions are being
thrown over module boundaries.

I am sorry, but what you want to do is virtually impossible.
different compilers are almost always incompatible.
Currently the system is deployed on Windows and components built with VC8,
7 and 6 are all used within the same process, due to efforts by Microsoft
to make their compilers/runtimes compatible this just works, will this
continue to be the case if the system is built for say Linux and several
versions of the compiler are mixed?

Microsoft is indeed a company that values binary compatibility.
If you would try to do this on linux, you would -in all likelihood- fail.
gcc is notorious for incompatibility across versions. In part this is
because the whole point of the open source is to advocate source
distribution.
providing binary compatibility would be like shooting yourself in the foot.
(I am all for binary standards, but that is just me.)

mixing different compilers (like gcc and msvc) for C++ is not going to work
either.

The only exception is if you create COM components. for COM to work, class
vtables have to have a specific layout.
Since every compiler supports COM, that is where your only option lies.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
Back
Top