I'm getting the follow error: "Type 'size_t' could not be resolved" on android ndk project, but I already added the library paths:
/Users/ademar/android-ndk-r8e/platforms/android-8/arch-arm/usr/include
/Users/ademar/android-ndk-r8e/sources/cxx-stl/stlport/stlport
/Users/ademar/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/include
so i not understand why this error.
code where I get the error:
static inline bool simplejson_wcsnlen(const wchar_t *s, size_t n)
I added each one of headers described here but still not working.
I Tried the follow:
#include <string.h>
#include <jni.h>
#include <android/log.h>
#include <iostream>
#include <stdio.h>
extern "C" {
JNIEXPORT jstring JNICALL Java_xxx_getStringFromJNI(JNIEnv* env, jobject thiz, jstring param) {
size_t x;
return env->NewStringUTF("test");
}
}
and it also not work...
size_t is defined in stddef.h which is compiler specific. In order to add it to the include path you have to add the /toolchain//prebuilt//lib/gcc///include to your path.
For example for building an android app on 64bit windows machine using ndk, you have to add <NDK-PATH>\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.8\include
to your path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With