Previous section   Next section

Imperfect C++ Practical Solutions for Real-Life Programming
By Matthew Wilson
Table of Contents
Chapter 9.  Dynamic Libraries


9.6. Dynamic Libraries: Coda

If you want to talk C++ across link units, you must stick with one compiler, and the same C/C++ run time libraries, or compilers that are mutually compatible in this regard, for example, Intel and Visual C++. Given what we learned in the previous two chapters, this seems like kind of a tautology. But the significance is that if we now look back at the C++ ABI issue, we can see that if a compiler had a compatible mangling scheme but had incompatible RTTI, object mode, and so on, it would be straightforward to produce programs whose correctness could never be verifiably asserted. That wouldn't be nice.

In practice, many (perhaps most?) programs are produced with C++ spanning link-units. However, the vast majority that do are done by a single compiler or by compilers with a shared C++ ABI. Conversely, interfacing with operating system and third-party link units is done via C.


      Previous section   Next section