Search code examples
c++multiple-inheritancevtable

C++ Separate Compilers for classes (vtables)?


I was wondering what the consequences are for compiling a class A with one compiler that doesn't allow multiple inheritance, and compiling a class B that does support it (and class B derived from class A).

I don't really understand the linking process...would it be possible to use both together? What disadvantages exist for using separate compilers in this situation, with vtables? Would it be impossible for code using class B to function properly?

Thanks.


Solution

  • As a general rule, don't ever compile parts of your C++ program with different compilers.

    Different compilers may use, and often do, different mangling schemas for the symbol mangling stage, so it's very unlikely that the linking between separately compiled stuff will work.

    See doc about mangling name_mangling