Android的NDK在Eclipse size_t类型无法解析 [英] Android NDK in Eclipse Type size_t could not be resolved
问题描述
我收到后续的错误:类型为size_t无法解析在Android NDK的项目,但我已经添加了库路径:
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在那里我得到的错误:
code where I get the error:
static inline bool simplejson_wcsnlen(const wchar_t *s, size_t n)
我添加页眉中的每一个描述这里,但仍然没有工作。
我试过如下:
#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在STDDEF.H这是编译器的具体定义。为了将其添加到include路径,你必须添加/工具链// prebuilt //的lib / GCC ///包括到您的路径。
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.
例如使用NDK构建64位Windows计算机上的Android应用程序,你必须添加<$c$c><NDK-PATH>\\toolchains\\arm-linux-androideabi-4.8\\$p$pbuilt\\windows-x86_64\\lib\\gcc\\arm-linux-androideabi\\4.8\\include$c$c>到您的路径。
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.
这篇关于Android的NDK在Eclipse size_t类型无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!