c++11compilationc++03ogrebulletphysics

is it possible to link a library compiled with c++11 to a code which needs to be compiled with c++03


I have ogre rendering code which compiles with c++03 but not with c++11.

I have bullet physics code which compiles with c++11 but not with c++03.

Now I want to interface them. Is it possible to compile bullet code with c++11 and call the resulting library from ogre code that is to be compiled with c++03.

my gcc version 4.8.4

OGRE is built as static. Bullet is also build as static.


Solution

  • Yes, it's possible as long as you use the same libstdc++ ABI, and as the new C++ 11 ABI has been introduced with g++ 5.1 (see using dual abi), it should be ok for you.

    edit : see this answer for a more complete answer, specially regarding ABI incompatibility with g++ 4.7.0 and g++ 4.7.1