• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI - DLL Problem  RSS feed

 
Stanley George
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have written a code in C and I am trying to call it in Java.

I used the free compiler lcc to create a dll:

lcc windowssysteminfo.c -If:\j2sdk1.4.2_03\include -If:\j2sdk1.4.2_03\include\win32

lcclnk -dll "windowssysteminfo.obj" netapi32.lib

I get this error:
Specified export _JNI_OnLoad@8 is not defined
Specified export _JNI_OnUnload@8 is not defined
Missing exports. Aborting

Java forum classifies it as: Bug ID: 4202204
This is what they gave as a solution:
Make JNI_CreateJavaVM, JNI_DefaultJavaVMInitArgs, and JNI_GetCreatedJavaVMs JNIIMPORT instead of JNIEXPORT.

I noticed that the above code is applicable when we call Java in C. What I am trying to do is the opposite.

Any suggestions would be highly appreciated.

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!