Exclamation: the eclipse! of God
First, I write the extern "C" void Func () {}; Code burst Red: (error:expected identifier or ' (' before string constant)
What the fuck!!
After Baidu is said C compiler does not support this writing, will error, although I know I use C + + compiler, but decided to change it
#ifdef __cplusplus
#define EXTERNC EXTERNC "C"
#else
#define EXTERNC
#endif
EXTERNC void Func () {};
Sure enough, still floating red.
No way, try to change to this:
#ifdef __cplusplus
#define extern extern
#define EXTERNC EXTERN "C"
#else
#define EXTERNC
#endif
The miracle appeared, does not explode red, compiles through!!!
Not happy, we'll change back.
#ifdef __cplusplus
#define EXTERNC EXTERNC "C"
#else
#define EXTERNC
#endif
Do not explode red, incredibly not red!!!
I just want to say that the Eclipse C + + compiler, Dirt!!!!
Android NDK development extern "C" compilation error