Android NDK development extern "C" compilation error

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.