Linking error - JNI_CreateJavaVM

I get the following error when using theJNI_CreateJavaVM function to embed a JVM in my c++ code...

Linking...

sample2.obj : error LNK2001: unresolved external symbol __imp__JNI_CreateJavaVM@12

Debug/sample2.exe : fatal error LNK1120: 1 unresolved externals

Error executing link.exe.

Help requested ASAP.

Regards

[369 byte] By [Freakkka] at [2007-10-3 11:13:36]
# 1
Link your C++ program with the {JDK_HOME}\lib\jvm.lib library.Regards
jfbrierea at 2007-7-15 13:37:25 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Thanks a lot for replying...

Now there is no compilation error.

But the function JNI_CreateJavaVM does not create JVM and is returning an error. What could be the reasons and how can i get away with this.

Message was edited by:

Freakkk

Message was edited by:

Freakkk

Freakkka at 2007-7-15 13:37:25 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

> What could be the reasons

It's because when starting the execution of your program the linked jvm.dll to load could not be found.

> how can i get away with this.

Before executing your program update the Path environment variable by adding the folder path of the jvm.dll location:

{JDK_HOME}\jre\bin\client

-or-

{JRE_HOME}\bin\client

Regards

jfbrierea at 2007-7-15 13:37:25 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4
Thanksss.....that has solved my problem :)
Freakkka at 2007-7-15 13:37:25 > top of Java-index,Java HotSpot Virtual Machine,Specifications...