Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3445138

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:00:18+00:00 2026-05-18T09:00:18+00:00

I want to include a C library in my Java project via JNI. I

  • 0

I want to include a C library in my Java project via JNI. I wrote the necessary JNI wrapper code and I have compiled and tested it in a Linux environment using gcc and make. Now I need to compile this to make a 64 bit Windows DLL, and I cannot get it to compile.

I downloaded Visual C++ Express 2010 and I have been using cl.exe on the command line. In the absence of knowing any better way to do it, I have just called cl.exe with all of the files I want to compile as arguments. I get a variety of errors:

Command line warning D9024: unrecognized source file type 'svm_jni.h'...

and

svm_jni.c(63) : error C2275: 'jobject' : illegal use of this type as an expression...

The first problem I have discovered is do to the fact that cl.exe does not accept .h files (I guess its only meant for C++ instead of C?). Is there a workaround for this? I could change all of the .h files to .c files and change the include statements, but I would prefer not to do this.

I have tried compiling using make and gcc on MinGW, but it always says that it cannot compile to a 64 bit target.

I have tried doing things through VC++ using the makefile project type, but I could not figure out how that works.

Any suggestions?

EDIT: I removed the .h files from the command line arguments and that solves part of the problem. I have been using

-I "C:\Program Files\Java\jdk1.6.0_21\include" -I "C:\Program Files\Java\jdk1.6.0_21\include\win32"

to get jni.h and jni_md.h. I still get

svm_jni.c(63) : error C2275: 'jobject' : illegal use of this type as an expression
    C:\Program Files\Java\jdk1.6.0_21\include\jni.h(83) : see declaration of 'jobject'

and a bunch of syntax and weird errors after that. I am assuming all the errors are the result of a common problem, but I don’t know whats going wrong.

Is there a 64 bit version of jni_md.h? The one I’m using now is in \include\win32

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Related Questions

I have a file that I want to include in Python but the included
I have a MySQL query in which I want to include a list of
I have two classes, and want to include a static instance of one class
How would I achieve the pseudo-code below in JavaScript? I want to include the
I want to include a batch file rename functionality in my application. A user
We want to include data visualization in our desktop GUI (mostly timelines and graphs;
I want to include a link in my SiteMaster (using Html.ActionLink) UNLESS the view
I make a user control and then want to include it on a page
I'm trying to highlight the search results but I want to include the surrounding
This is similar to this question , but I want to include the path

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.