0

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?

2
  • 2
    Recompiling with the current compiler is a good idea anyway. Commented Oct 6, 2021 at 15:07
  • library call standards are same in 90's elf32. call conventions are invented in 80's Commented Oct 6, 2021 at 15:10

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I hope you mean "function prototypes" and not "header files".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.