Click here to Skip to main content
15,913,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have already tried "How to Call Java Functions from C Using JNI By ajalilqarshi" when i tried the code i got the following errors:

1>VC_JAVA.obj : warning LNK4248: unresolved typeref token (0100000F) for '_jmethodID'; image may not run
1>VC_JAVA.obj : error LNK2028: unresolved token (0A000011) "extern "C" long __stdcall JNI_CreateJavaVM(struct JavaVM_ * *,void * *,void *)" (?JNI_CreateJavaVM@@$$J212YGJPAPAUJavaVM_@@PAPAXPAX@Z) referenced in function "struct JNIEnv_ * __cdecl create_vm(struct JavaVM_ * *)" (?create_vm@@$$FYAPAUJNIEnv_@@PAPAUJavaVM_@@@Z)
1>VC_JAVA.obj : error LNK2019: unresolved external symbol "extern "C" long __stdcall JNI_CreateJavaVM(struct JavaVM_ * *,void * *,void *)" (?JNI_CreateJavaVM@@$$J212YGJPAPAUJavaVM_@@PAPAXPAX@Z) referenced in function "struct JNIEnv_ * __cdecl create_vm(struct JavaVM_ * *)" (?create_vm@@$$FYAPAUJNIEnv_@@PAPAUJavaVM_@@@Z)
1>C:\Documents and Settings\372577\My Documents\Visual Studio 2008\Projects\VC_JAVA\Debug\VC_JAVA.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\372577\My Documents\Visual Studio 2008\Projects\VC_JAVA\Debug\BuildLog.htm"
1>VC_JAVA - 3 error(s), 1 warning(s)


While i am using jdk1.6.0_23 version. Do i need to change jdk 1.6 to this version?
Thank you
Posted
Updated 18-Nov-11 0:01am
v3
Comments
Mehdi Gholam 18-Nov-11 5:47am    
EDIT -> fixed formatting
Niklas L 18-Nov-11 6:07am    
Looks like you are missing to include a library file for JNI in your project.

1 solution

you need to include the libs of the JNI interface so you can link properly.
 
Share this answer
 
Comments
Member 8413059 22-Nov-11 2:39am    
Where do i get the lib of JNI interface??
As i have already searched it in google but couldn't find it.Please help me out .Thanks in advance...
KarstenK 23-Nov-11 2:45am    
search in the JNI SDK there must be some libs

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900