Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid NDK Samples Compilation error: string.h: No such file or directory
    primarykey
    data
    text
    <p>I'm trying to compile the Android ndk example android-ndk-r6b/samples/hello-jni and i'm not having luck.</p> <p>The compilation error i'm getting is:</p> <pre><code> $:/media/rober/android/android-ndk-r6b/samples/hello-jni$ ndk-build Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver Gdbsetup : libs/armeabi/gdb.setup Compile thumb : hello-jni &amp;lt= hello-jni.c /media/rober/android/android-ndk-r6b/samples/hello-jni/jni/hello-jni.c:17:20: error: string.h: No such file or directory /media/rober/android/android-ndk-r6b/samples/hello-jni/jni/hello-jni.c:18:17: error: jni.h: No such file or directory /media/rober/android/android-ndk-r6b/samples/hello-jni/jni/hello-jni.c:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Java_com_example_hellojni_HelloJni_stringFromJNI' make: *** [/media/rober/android/android-ndk-r6b/samples/hello-jni/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] Error 1 </code></pre> <p><br/> The environment:<br/></p> <pre> Ubuntu $:/media/rober/android/android-ndk-r6b/samples/hello-jni$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 11.10 Release: 11.10 Codename: oneiric Java $:/media/rober/android/android-ndk-r6b/samples/hello-jni$ java -version java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode) Make $:/media/rober/android/android-ndk-r6b/samples/hello-jni$ make -v GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i686-pc-linux-gnu AWK $:/media/rober/android/android-ndk-r6b/samples/hello-jni$ awk -W version mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan compiled limits: max NF 32767 sprintf buffer 1020 Android $:/media/rober/android/android-ndk-r6b/samples/hello-jni$ export | grep ANDROID declare -x ANDROID_HOME="/media/rober/android/android-sdk-linux_86" declare -x ANDROID_NDK="/media/rober/android/android-ndk-r6b/" declare -x ANDROID_NDK_ROOT="/media/rober/android/android-ndk-r6b/" declare -x ANDROID_SDK_HOME="/media/rober/android/android-sdk-linux_86" PATH ( splitted by "\n" for easy reading ) $:/media/rober/android/android-ndk-r6b/samples/hello-jni$ export | grep PATH | grep bin declare -x PATH=" /media/rober/dev/apache-ant-1.7.1/bin: /media/rober/dev/apache-maven-3.0.3/bin: /media/rober/android/android-sdk-linux_86/platform-tools: /media/rober/android/android-sdk-linux_86/tools: /media/rober/android/android-ndk-r6b/: /usr/lib/lightdm/lightdm: /usr/local/sbin: /usr/local/bin: /usr/sbin: /usr/bin: /sbin: /bin: /usr/games: /media/rober/dev/jdk1.6.0_22/bin: /media/rober/dev/apache-ant-1.7.1/bin: /media/rober/dev/apache-maven-3.0.3/bin: /media/rober/android/android-sdk-linux_86/platform-tools: /media/rober/android/android-sdk-linux_86/tools: /media/rober/android/android-ndk-r6b/ </pre> <p>I have the feeling that i'm missing an environment variable or some sort of configuration that tells the ndk where to look up for the string.h and jni.h files, even when they are inside the same ndk directory structure, but i'm not really sure what's going.</p> <p>All sort of tips are very welcome :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload