Search code examples
c++android-ndkcocos2d-xextern-c

unknown attribute `extern_c` warning in C++


I’m building a Cocos2d-x game for Android on a Mac, using Android NDK, and I get many warnings like this when compiling the C++ part:

/usr/include/module.map:1662:22: warning: unknown attribute 'extern_c' [-Wignored-attributes]

Is it dangerous? How can I fix it?


Solution

  • I'm guessing that extern_c is a compiler directive for the module map saying it is referencing functions from C++ that were written in the C language (different call frame structure).

    The LLVM portion of the CLANG compiler is probably having a version mismatch. http://clang.llvm.org/docs/Modules.html#module-maps

    Try a command line $ clang -v

    You may have to verify the compiler library version xcode->preferences->locations->command line tools.

    Ultimately you will want to clear this up so your stack frames match the arguments and your not referencing a C language function.