Based on this question , I understand the purpose of the construct in linking C libraries to C ++ code. Now suppose the following:
I have a '.so' shared library compiled with a C ++ compiler. The header has a "typedef stuct" and a series of function declarations. If the header contains the extern expression "C" ...
#ifdef __cplusplus extern "C" { #endif
... what is the effect? In particular, I am wondering if there are any negative side effects of this declaration, since the shared library is compiled as C ++, not C.
Is there any reason for declaring extern "C" in this case?
c ++ c linux shared-libraries extern
Adam holmberg
source share