ERROR: '__NDK_FPABI__' does not name a type

僤鯓⒐⒋嵵緔 提交于 2020-01-11 09:35:48

问题


While compiling native code-base, I'm getting the following error -

<NDK-HOME>/platforms/android-17/arch-arm/usr/include/jni.h:235:68: error: expected ';' at end of member declaration
<NDK-HOME>/platforms/android-17/arch-arm/usr/include/jni.h:235:70: error: '\__NDK_FPABI__' does not name a type
...

With tons of repetitions.

Platform related details are as below -

Native OS: Windows 7 (64 bit) with Cygwin64
NDK Version: r9c

A similar problem has been reported here. However, even after modifying LOCAL_CFLAGS, I couldn't find the intermediate files as suggested.

Was wondering if some of you have faced this problem already and if so, do you guys have a work-around for this?


回答1:


Alright, finally got rid of these __NDK_FPABI__ errors and my native code compiled just fine. Indeed, there were subtle hints in the intermediate files (*.i and *.ii) as suggested by Andrew in the link on my previous post; these are usually related to finding appropriate headers. Once relevant changes were made, things worked like a charm.

Few things I learned while debugging this issue -

  • The problem was related to header files. Certain headers were being picked up from /usr/include which otherwise should have been picked up from $NDK_HOME/platform/$ANDROID_VERSION/$ARCH/usr/include. Making necessary changes in the Android makefile fixed the issue for me.
  • Always resist the temptation of adding hot-fixes to NDK files. This will make your life a lot easier in the long run.
  • One should look for the intermediate files (*.i, *.ii, *s and few others) in $PROJECT_ROOT, instead of $PROJECT_ROOT/jni (assuming native code lies there).
  • The latest release of NDK, namely ndk-r9d fixes some of the issues with __NDK_FPABI__ related errors.

Hope this helps!



来源:https://stackoverflow.com/questions/22106857/error-ndk-fpabi-does-not-name-a-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!