Static declaration follows Non-static declaration

Source: Internet
Author: User

In the previous period of time work to compile cross-platform third-party libraries for Android, encountered Arc4random about the function of the "static Declaration follows Non-static declaration" problem, That's because the NDK provides a runtime that is not the same for arc4random support, or supports only some other functions or only other functions, whereas the automatic configuration script of a third-party library meets either full support or no support, providing a statically implemented code. This is where the function declares the static in the implementation code after it is declared in the runtime header file. The solution can only be manually modified for each CPU system version.

Today in compiling the OpenSSL 0.98b version also encountered this error, this time is a variable. Here's what this culprit is:

Openssl_implement_global.

It wants to hide variable name variables into static, export an access function, and use the macro to initialize the variable, the end of the macro is not ";" The enclosing statement.

Openssl_implement_global (int, some_var) = 1; Did you get it?

However, an explicit extern declaration is made, then referenced, and finally static is defined and initialized.

No IDE Analysis project, looking for a macro is really not easy to find, compile error, and will not be prompted to define the macro there, just pointing to the macro error, you do not know what the macro is intended. Although you can traverse the directory to find matching words from the file.

Static declaration follows Non-static declaration

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.