I get the following error ad-infinitum:
error LNK2001: unresolved external symbol __imp__JNI_CreateJavaVM@12
When I comment the line out calling the JNI_CreateJavaVM() it compiles and links so I know DestroyJavaVM() is compiling-linking properly. Why would one method link and another not? I used Depends to see if the method was sitting in the jvm.dll, (and it is). Any help will be monetarily rewardable!
#include "stdafx.h"
#include <jni.h>
extern "C"
{
int main(int argc, char* argv[])
{
JavaVM* vm = NULL;
void* env = NULL;
JavaVMInitArgs vm_args;
JavaVMOption options[4];
options[0].optionString = "-Djava.compiler=NONE";options[1].optionString = "-Djava.class.path=c:\\myclasses";options[2].optionString = "-Djava.library.path=c:\\mylibs";options[3].optionString = "-verbose:jni";/* print JNI-related messages */
vm_args.version = JNI_VERSION_1_4;
vm_args.options = options;
vm_args.nOptions = 4;
vm_args.ignoreUnrecognized = JNI_TRUE;
jint nRet1 = JNI_CreateJavaVM(&vm, (void **)&env, &vm_args);
jint nRet2 = vm->DestroyJavaVM();
return 0;
}
}