c - Compiling 64 bit DLL for JNI -


i want include c library in java project via jni. wrote necessary jni wrapper code , have compiled , tested in linux environment using gcc , make. need compile make 64 bit windows dll, , cannot compile.

i downloaded visual c++ express 2010 , have been using cl.exe on command line. in absence of knowing better way it, have called cl.exe of files want compile arguments. 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 type expression... 

the first problem have discovered fact cl.exe not accept .h files (i guess meant c++ instead of c?). there workaround this? change of .h files .c files , change include statements, prefer not this.

i have tried compiling using make , gcc on mingw, says cannot compile 64 bit target.

i have tried doing things through vc++ using makefile project type, not figure out how works.

any suggestions?

edit: removed .h files command line arguments , solves part of problem. 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 jni.h , jni_md.h. still get

svm_jni.c(63) : error c2275: 'jobject' : illegal use of type expression     c:\program files\java\jdk1.6.0_21\include\jni.h(83) : see declaration of 'jobject' 

and bunch of syntax , weird errors after that. assuming errors result of common problem, don't know whats going wrong.

is there 64 bit version of jni_md.h? 1 i'm using in \include\win32

you don't want compile header files, rather want include them in compilation path when compile c/c++ files.

as jobject issue, need include jni header files located under %java_home%\include directory.

for visual c++ express, did download 64 bit building tools? , when state gcc , mingw cannot compile 64 bit target, message getting exactly? have mingw-w64?


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -