jni.h: no such file or directory

前端 未结 1 1066
故里飘歌
故里飘歌 2020-12-03 02:55

I\'m using Code::Blocks in windows.

I created a dll project trying to get some JNI practice.

In my .h file generated by javah, there\'s #include jni.

相关标签:
1条回答
  • 2020-12-03 03:23

    You have to add the JDK path to the include path, so the compiler knows the location of the file.

    Windows:

    /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32"
    

    Linux:

    -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/linux"
    

    Mac:

    -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/darwin"
    
    0 讨论(0)
提交回复
热议问题