Friday, December 20, 2013

eclipse ndk resolve problem

eclipse seem not to resolve includes automatically. I just add those path manually. If adding them does not work, you can remove all the .* configures and import the clean project and add native code again. At least it works for me.

jni
/usr/lib/jvm/java-7-openjdk/include/

clang(I use clang, you can replace it with gcc 4.8)
/opt/android-ndk/toolchains/llvm-3.3/prebuilt/linux-x86_64/lib/clang/3.3/include/

libc++(I use libc++, you can replace it with gnustl)
/opt/android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/

platform specific includes (such as GLES2)
/opt/android-ndk/platforms/android-19/arch-arm/usr/include/

extra includes(such as eigen3 or boost)
/path/to/your/include


Here is my include path config export

includes.xml

<?xml version="1.0" encoding="UTF-8"?>
<cdtprojectproperties>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.IncludePaths">
<language name="c,cpp">
<includepath>/usr/lib/jvm/java-7-openjdk/include/</includepath>
<includepath>/opt/android-ndk/toolchains/llvm-3.3/prebuilt/linux-x86_64/lib/clang/3.3/include/</includepath>
<includepath>/opt/android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/</includepath>
<includepath>/opt/android-ndk/platforms/android-19/arch-arm/usr/include/</includepath>
<includepath>/home/jesse/local/android_toolchain/include</includepath>

</language>
</section>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">
<language name="c,cpp">

</language>
</section>
</cdtprojectproperties>

No comments:

Post a Comment