Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved inclusion error while using NDK

enter image description here
I am using Android NDK but the .c file in the JNI folder is showing the error of Unresolved inclusion as shown in the image: Kindly help me in solving this issue. I have tried almost everything I could find on internet but unable to solve it. For a C/C++ project I can use the build path\paths and symbols option to solve the inclusion but for an android project, this option is not available in project properties.

like image 744
Waneya Iqbal Avatar asked Oct 17 '11 20:10

Waneya Iqbal


2 Answers

This is a bug in the ADT plugin (or rather, it sounds like an incompatibility with the newer version of CDT for Eclipse) on Windows documented here: http://code.google.com/p/android/issues/detail?id=33788

There's a preview of a new version which fixes the problem described here: http://tools.android.com/download/adt-21-preview#TOC-Installation

Here's what I needed to do to fix the problem:

  1. Enable Preview Tools in the Options of the SDK Manager, then install the preview version of the SDK tools.
  2. Install the preview version of ADT and NDK plugins in Eclipse using the link in the preview description linked above.
  3. Re-create my project so that I could re-do the "Add Native Support" step (apparently required for the fix to work).

It's probably possible to accomplish #3 by editing appropriate project files rather than re-creating, but since I'm in early stages of development I didn't experiment with that.

like image 125
Andrew Avatar answered Oct 01 '22 16:10

Andrew


Had the same issue, resolved it by fixing the path in project properties (C/C++ General / Paths and Symbols / Includes) from:

${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include

to:

${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include

like image 43
Evgeny Erlihman Avatar answered Oct 01 '22 14:10

Evgeny Erlihman