Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 714
DavidGuaita Avatar asked May 26 '26 10:05

DavidGuaita


1 Answers

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.

like image 141
bobwilmes Avatar answered Jun 04 '26 23:06

bobwilmes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!