Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes calling a pre-existing dll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "calling a pre-existing dll" Watch "calling a pre-existing dll" New topic
Author

calling a pre-existing dll

Vinny Iyer
Greenhorn

Joined: Sep 04, 2001
Posts: 1

Hi all. I'm sorta new to JNI and I had a question. I have a pre-existing dll called "mydll.dll" and its header file "mydll.h"
I am trying to access a funtion " int GetVersion() " using JNI.
I have written the following C funtion to access the function in the dll
JNIEXPORT jint JNICALL
Java_myApp_GetVersion(JNIEnv *env, jobject obj)
{
jint myInt;
myInt = (*env)->GetVersion();
return myInt;
}
However, when I try to compile this I get the following error
Error E2451 : Undefined symbol 'GetVersion' in function Java_myApp_GetVersion
What am i doing wrong here? Is this the correct way to call the function? Or is the problem caused because of the location of "mydll.dll". Right now it is in the same directory as the C file and the Java classes.
Thanks for your help.
Vinny.

[This message has been edited by Vinny Iyer (edited September 19, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling a pre-existing dll
 
Similar Threads
JNI
jni methos in c++ class
Java --> C++ communication via JNI.
Please, help me!!! ...to write implementation for this C function
Embedded VM in a cpp code and crash information