• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

JNI Tutorial (Step 5)

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Dinner will be steamed monkey heads with a side of tiny ads.
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic