Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Mike Burton

Greenhorn
+ Follow
since Feb 15, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Burton

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;
}
}
21 years ago