请问高手,我用java 调用vc生成的*.dll 时候的问题。 十分火急!!!!!!!!!!!!!!!
       当我想用vc生成动态库文件,步骤是我生成一个动态库工程,然后把"nativedemo.h"加进去,编译成动态库文件就可以。可是我需要先把test.cpp文件生成应用文件。可是把它生成应用文件的时候,出现一些错误。
我现在有文件叫 test.cpp
如下:#include "nativedemo.h"
#include <stdio.h>JNIEXPORT jint JNICALL Java_NativeDemo_test(JNIEnv *, jobject)
{    printf("hello:!\n");
    printf("this is in the native method!\n");
    
} 还有用javah 生成的 nativedemo.h 文件 如下:/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class NativeDemo */#ifndef _Included_NativeDemo
#define _Included_NativeDemo
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     NativeDemo
 * Method:    test
 * Signature: ()I
 */
JNIEXPORT jint JNICALL Java_NativeDemo_test
  (JNIEnv *, jobject);#ifdef __cplusplus
}
#endif
#endif
 当我先把 test.cpp 文件先编译成应用文件的时候错误如下:
e:\vc\test\test.cpp(1) : fatal error C1083: Cannot open include file: 'jni.h': No such file or directoryError executing cl.exe.请问高手原因是什么?我在环境变量里已经设置为:
INCLUDE=d:\java\include;d:\java\win32;%INCLUDE%
LIB =d:\java\lib;%LIB%
还有那里有问题?楼上的兄弟和其他的兄弟们。