File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Problem in compiling C file with JNI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem in compiling C file with JNI" Watch "Problem in compiling C file with JNI" New topic
Author

Problem in compiling C file with JNI

rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Hello to all,
I have a JNI tutorial in which a JNI program in developed.
But after creating the header file using "javah -jni " command when I use that header file in to the C implementation it gives error
Following code is of HelloWorld.cpp in which the header file in included

The error is


I have copied the header file to the include directory for TurboC folder.
My java class "HelloWorld.java" is

After compiling I use "javah -jni HelloWorld" which produce HelloWorld.h file

Please suggest me what to do.
Thanks in advance
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Is your HelloWorld.h file located in the same folder as the HelloWorld.cpp folder? Is this also the current folder when invoking your compiler?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Yes I the header file is in same folder in which my HelloWorld.cpp file is.

Even I have copied it to the include directory of turboc but same error arise.
Thank for your reply
rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Can any one please suggest me what to do??
What is the problem, that I am not able to compile the C program.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in compiling C file with JNI
 
Similar Threads
JNI What is it, and can I use it
JNI Program RunTime Exceptions
Link Error Which is Never Satisfied
how to invoke a dll
How to Connect C using (JNI) java native Interface??