• 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.h not compiling. Seriously stuck...

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys - here's the deal. I've written a routine in C which needs to be linked into a Java GUI. Major problem - I cannot get the JNI to do what it's supposed to. I think this could be a problem with Borland C++, but I could do with some advice. I'm using 4.52, but I have also tried version 5 and neither are doing their stuff. jni.h doesn't seem to be compiling in either. Big GRRRrrrrrs.
 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure your include diretories and library paths are set correctly
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some code would help.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Silly question maybe, but are you creating code stubs using the <code>jni</code> utility, attempting to do it by hand is a recipe for disaster.
A
 
Ruth Gow
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean by the jni utility. I'm doing what all the stuff I've read about jni says to do - using javah to make the header file and #include-ing the jni.h and the header file in my C code. Everything seems to compile, but I get massive error messages when it hits jni.h. All about missing parentheses it seems.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The method that you have declared in C declare it in java again & just initialize it with the Keyword "native",hope it works.
 
reply
    Bookmark Topic Watch Topic
  • New Topic