- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
运行以下命令后,我收到一个错误
gcc prog.c -o prog -I"C:/Program Files/Java/jdk1.8.0_25/include" -I"C:/Program Files/Java/jdk1.8.0_25/include/win32"
error: unknown type name '_int64'
请告诉我如何修复此错误。
#include <string.h>
#include <jni.h>
jstring Java_com_mindtherobot_samples_ndkfoo_NdkFooActivity_invokeNativeFunction(
JNIEnv* env, jobject javaThis) {
return (*env)->NewStringUTF(env, "Hello from native code!");
}
最佳答案
以下应该有助于缓解这个问题:
Building JNI-based Java Applications under Linux and Cygwin
Java mods for Cygwin Builds
Under Cygwin, the JNI (Java Native Interface) library we created called JNILibrary doesn’t build because gcc doesn’t know about the type “__int64″. You’ll know you hit the problem if you see something like this:
Building JNILibrary class and header…. In file included from /cygdrive/c/j2sdk1.4.2_12/include/jni.h:27, from JNICrunch-common.h:25,
from JNICrunchHWInfo.c:31:
/cygdrive/c/j2sdk1.4.2_12/include/win32/jni_md.h:16: error: parse error before “jlong”. /cygdrive/c/j2sdk1.4.2_12/include/win32/jni_md.h:16: warning: data definition has no type or storage classIf you do hit this, then you need to edit /cygdrive/c/j2sdk1.4.2_12/include/win32/jni_md.h and change these lines:
typedef long jint;
typedef __int64 jlong;
typedef signed char jbyte;to:
typedef long jint;
#ifdef __GNUC__
typedef long long jlong;
#else
typedef __int64 jlong;
#endif
typedef signed char jbyte;
#include <stdint.h>
之前 #include <jni.h>
在标题中... 或 -D__int64=int64_t
关于java-native-interface - 在 cygwin 中编译时出错——错误 : unknown type name '_int64' -- (jni. h),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27891478/
我是一名优秀的程序员,十分优秀!