1

I have a C++ 11 (currently compiling with GCC 4.8.5) project using C++ 11 static built (with GCC 4.8.5) external dependencies.

I would like to know if I need to compile these external dependencies with C++ 20 (GCC 9.2.0) to compile my project with C++ 20 (GCC 9.2.0) ?

Meugiwara
  • 599
  • 1
  • 7
  • 13
  • 1
    [This might be helpful](https://stackoverflow.com/q/2801938/1387438) it leads to [this source](https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) and [this](http://abicheck.sourceforge.net/). – Marek R Mar 10 '22 at 10:43

1 Answers1

0

If you are including the file, it should be compatible as higher C++ version as C++ updates simply add more features. C++ code in a lower version should work in a higher version. So I recommend including the file but compiling separately should work too.

  • not actually the case here, gcc previously used Copy on Write strings. These were made incompatible with the standard in C++11. GCC 4.8.5 is pre C++11 and still uses COW strings and thus is ABI incompatible with later versions. In otherwords libstdc++ had a very hard ABI break between 4.8.5 and 5.0 – Mgetz Mar 10 '22 at 14:52