• 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

"jni_md.h: No such file or directory"- Error Message while compiling C source code

 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I created a HelloWorld.java file then used javap -h to create HelloWorld.h. Included this header file and jni.h in the C source code. I am using Cygwin on Windows XP. I copied the header files in JAVA_HOME\include directory to usr\include directory of the Cygwin installation on Windows. After doing all this when i try to compile using gcc HelloWorld.c i get a huge list of error messages the first one being "" I guess the other messages might be due to this one.

My HelloWorld.c Source:



I tired to google with the error message but could not get much help. Also i am using Cygwin with JDK 1.6 U13

Thanks
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also include JAVA_HOME/include/linux (I think this is the one; I'm on Windows where it's called win32).
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Also include JAVA_HOME/include/linux (I think this is the one; I'm on Windows where it's called win32).



Oh i forgot to mention that- I did copy the header files from the JAVA_HOME\include\win32. I also tried using gcc with -I option specifying both the include fields- JAVA_HOME\include and JAVA_HOME\include\win32. Earlier i used to get jni.h not found but after copying both the directories i get the message jni_md.h not found.
 
Rob Spoor
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you keep the jni_md.h in the win32 folder? Because if you're using them directly in your application path, you shouldn't - jni.h includes which means the same folder as you currently are.
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Did you keep the jni_md.h in the win32 folder? Because if you're using them directly in your application path, you shouldn't - jni.h includes



I tried copying the jni_md.h file to the same folder where jni.h is available. This time its showing the following error messages:



After this there's a long list of errors stating parse error before '*' token
 
Rob Spoor
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's Try changing that to Cygwin probably doesn't know the __int64. Also check out http://www.graphics-muse.org/wp/?page_id=147
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot. I am able to create the object code and then the DLL now.

But there's a different problem now. when i run java HelloWorld (the name of the java class is HelloWorld) the command line cursor keeps blinking but there's no output. It does not execute and keeps waiting for the output. Any hints on this?

Regards,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic