Using g++ how can I link with a library that was built using gcc?
-
09-09-2019 - |
Question
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
Solution
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"
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow