Hello,
Someone please help me. What I am trying to do is load two .DLL files in my program. Program works fine when I
do the following way i.e. I have two .java files and in each I am loading one .DLL file. But I don't want to have
two .java files I want to load both the .DLL files in one program.
**************** Example.java **********
import java.io.*;
import java.util.*;
public class Example
{
public native int A(String in);
static
{
System.loadLibrary( "API2" );
}
public static void main( String args[])
{
Ex ex = new Ex();
int r;
r = ex.A("TEST");
}
public Example()
{
}
}
*****************Ex.java*****************
public class Ex
{
public native int A(String in);
public Ex()
{
System.loadLibrary("API3");
}
}
*******************************************
The above way works. But I need only one .java file to load both the .DLL files. i.e.
import java.io.*;
import java.util.*;
public class Example
{
public native int A(String in);
static
{
System.loadLibrary( "API2" );
System.loadLibrary( "API3" );
}
public static void main( String args[])
{
Example ex = new Example();
int r;
r = ex.A("TEST");
}
public Example()
{
}
}
but when I do this way it doesn't work and I get a UnSatisfiedLinkage Error at ex.A("TEST"). While doing the top way it works.
How can I fix this to just have one .java file and load both the library files as done in the bottom program but doing this program doesn't work.
Can we load multiple libraries into a single class?
I want to load multiple libraries into a single class but doing that I get LinkError.
Any help is appreciated.
Thanks!
Someone please help me. What I am trying to do is load two .DLL files in my program. Program works fine when I
do the following way i.e. I have two .java files and in each I am loading one .DLL file. But I don't want to have
two .java files I want to load both the .DLL files in one program.
**************** Example.java **********
import java.io.*;
import java.util.*;
public class Example
{
public native int A(String in);
static
{
System.loadLibrary( "API2" );
}
public static void main( String args[])
{
Ex ex = new Ex();
int r;
r = ex.A("TEST");
}
public Example()
{
}
}
*****************Ex.java*****************
public class Ex
{
public native int A(String in);
public Ex()
{
System.loadLibrary("API3");
}
}
*******************************************
The above way works. But I need only one .java file to load both the .DLL files. i.e.
import java.io.*;
import java.util.*;
public class Example
{
public native int A(String in);
static
{
System.loadLibrary( "API2" );
System.loadLibrary( "API3" );
}
public static void main( String args[])
{
Example ex = new Example();
int r;
r = ex.A("TEST");
}
public Example()
{
}
}
but when I do this way it doesn't work and I get a UnSatisfiedLinkage Error at ex.A("TEST"). While doing the top way it works.
How can I fix this to just have one .java file and load both the library files as done in the bottom program but doing this program doesn't work.
Can we load multiple libraries into a single class?
I want to load multiple libraries into a single class but doing that I get LinkError.
Any help is appreciated.
Thanks!