• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

location of jni.h and jni_md.h?

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic