I compiled an open source C++ library using an old GCC 4.8.5. Now, I am planning to update my C++ executables using GCC 8.3.1 with -std=c++17. Do I still need to recompile also the open source library to match the GCC version used in the executables?
Asked
Active
Viewed 115 times
1
-
4The library predates GCC 5, and its [C++11 ABI](https://stackoverflow.com/questions/36159238/linking-problems-due-to-symbols-with-abicxx11). You should recompile. – MSalters Nov 10 '20 at 08:32
-
1Even if you don't have to, is there a reason to not do it? A way more modern compiler version should deliver better results. – mch Nov 10 '20 at 08:33
-
1A simple example of binary incompatibility: both versions report a different byte size of objects of type `std::string`: https://godbolt.org/z/YT4xTn. – Daniel Langr Nov 10 '20 at 08:48
-
@MSalters ohh okay I see. thank you. I will recompile then. – TheCaffeinatedDev Nov 10 '20 at 08:53
-
@mch I was just trying to save a little time recompiling across different servers. I know my reason is a bit lazy and unacceptable. Your point is valid about modern compiler version deliver better results. Thanks. – TheCaffeinatedDev Nov 10 '20 at 08:55
-
@DanielLangr Ohh thanks for this. It's time for recompilation then. Thank you – TheCaffeinatedDev Nov 10 '20 at 08:56