• Post Reply Bookmark Topic Watch Topic
  • New Topic

location of jni.h and jni_md.h?  RSS feed

 
Robin Clark
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making my first attempt at JNI. I've written my native method implementations and I am trying to create the shared library (in my case a dll since I am developing for Windows 2000). I get an error because the compiler can not find jni.h and jni_md.h. I fixed the error by copying these two header files into the directory where my native method implementation .cpp file is located and changing the #include from using angle brackets to "".
I know that this was not the correct thing to do. Where should jni.h and jni_md.h be located? Is it normal to have to copy these files there? Or should I be changing an environment variable that MSVC++ 6.0 uses in order to locate system header files?
Thanks for your help.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should leave the headers where they belong, but add settings to your project to tell the compiler where to find them. The command-line settings should look like (I believe)
/I C:\j2sdk1.4.2\include /I C:\j2sdk1.4.2\include\win32
It's been a few years since I've seen VC++, so I can't tell you exactly where to put this, but it's going to be part of the project settings.
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In fact exactly where you specify this will be different for VS6 and VS.NET.
But Project->Properties is where to start.
Guy
 
Robin Clark
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are exactly right. It has been too long since I used MSVC++ 6.0. You can either specify where to find includes via the command line or via Project->Settings. Thank you very very much!
 
Kamala Miller
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Microsoft Visual C++ 6.0, you have to put the command line instructions into the bottom box (titled "Project Options") of the "C/C++" tab. Just figured I'd let people know, since it took me a little trial and error to figure out where to put the command!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!