Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNI Tutorial (Step 5)

 
Michael Brewer
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going through the JNI Tutorial on Sun's Website. I'm on step 5 and I can't seem to get the C file compiled into a DLL. I understand that this isn't really a Java question, but I'm not a C guy, I have nowhere else to go, and I encountered this problem in the midst of a Java tutorial, so...
Can someone tell me how to compile the C file into a DLL? I'm entering the following on the command line:And I get the following error:
I copied stdio.h into the same folder as my Java, header, and C files. But, it still gives me this error. Can anyone help?
 
Vikas Varma
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it requires the standard stdio.h files for the VC++ compiler. Usually it should be there ur msvc++ directory.
Try using the -I flag and initialize it to the VC++ include files. For example -I c:\msvc++\include.
Hope it works..
--Vikas
 
Michael Brewer
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I changed my command string to:And now I get the following error:
And now I'm completely baffled. I would really appreciate any help on this.
 
Michael Brewer
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vikas Varma:
Try using the -I flag and initialize it to the VC++ include files. For example -I c:\msvc++\include.

Thanks. I didn't see your post until after I posted my second comment. Is JavaRanch slow on updating threads or did my browser just not reload the page?
 
Vikas Varma
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Brewer:

Thanks. I didn't see your post until after I posted my second comment. Is JavaRanch slow on updating threads or did my browser just not reload the page?

Ok! now I think the C program has compiled successfully.
Now its a Linking error.
Check out the options for setting the library path for linking the libraries.
--Vikas
 
Michael Brewer
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vikas.
Thanks to this page I found out that I needed to run in order to setup the environment. Why I should have to do that on Windows, I don't know. I then got the following response which I assume is successful:
On to step 6!
[ February 13, 2003: Message edited by: Michael Brewer ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic