0

I am trying to link a .a library that was built with gcc to a program built using g++. But the name mangling is different. How can I do this? Thanks, CP

1 Answer 1

5

In your C++ code, you just need to wrap your includes of the gcc library header file(s) in extern "C":

extern "C" {
#include "my_library.h"
}
Sign up to request clarification or add additional context in comments.

Comments

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.