Saad Rami
Saad Rami

Reputation: 81

Compiler version in C++ vs pre-compiled C libraries

I have a code that uses std=c++20.

I want to use a C library that was build with old gcc version.

Should I recompile the C library using the same compiler ?

If no, how could you judge that the 2 ABIs are compatible?

Upvotes: 0

Views: 118

Answers (1)

anton-tchekov
anton-tchekov

Reputation: 1098

There should be no problem using the library as it is. Don't forget to add extern "C" around the function prototypes.

More info: Using C Libraries for C++ Programs

Upvotes: 1

Related Questions