Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » DLL application import problem
DLL application import problem [message #164107] Mon, 20 February 2006 06:42 Go to next message
Eclipse UserFriend
Originally posted by: jpilecki.poczta.onet.pl

Hello,
I'm not sure my question shoud be sent to this newsgroup, being more JNI
than CDT problem, but since there is no group dedicated to JNI, I'm sending
it here.

I'm trying to translate a program from pure java to eclipse enviroment.
It's mainly extensive DLL library with only bits of code in form of
interface. It works just fine with java, but attempt to use eclipse causes
problems. I'm receiving "unsatisfiedLinkError" in response.
Most of those problem steems from a fact, that I have no access to it's
actual code.

I have:
- dll library
- several >already compiled< *.class files, serving as intercafe
- code that works in pure java

I tried:
- writing my own "native"
- decompiling *.class files

What I cannot do:
- ask 'dll' creator for help
- use oryginal *.java files as interface
- create proper CDT project (I do not have source codes)


JAVA CODE (working):

public class jex1 {
static {
try { System.loadLibrary("qcs"); }
catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}

public static void main(String argv[]) {
qcs.initialize_qcs_core_library();
}
}


ECLIPSE CODE (not working)

public class class1 {

static {
try { System.loadLibrary("qcs"); }
catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}

public static void main(String argv[]) {
qcs.initialize_qcs_core_library();
}
}

ERROR MESSAGE:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
initialize_qcs_core_library
at def.qcsJNI.initialize_qcs_core_library(Native Method)

at def.qcs.initialize_qcs_core_library(qcs.java:1143)

at pack1.class1.main(class1.java:39)


I would be gratefull for any help.
Jakub Pilecki
Re: DLL application import problem [message #164153 is a reply to message #164107] Mon, 20 February 2006 14:47 Go to previous message
Eclipse UserFriend
Originally posted by: jpilecki.poczta.onet.pl

I've found source of a problem.

Dll was compiled under normal java, without any package. In Eclipse I put a
classes in a package. Both cases are translated through JNI directly. I
would need to recompile dll to make it work. Simpler solution is to put all
clases into defaulf package.

If anyone is interested in differences in translation - I found answer here:
https://lists.xcf.berkeley.edu/lists/advanced-java/2000-June /030169.html

Jakub



U
Previous Topic:Multiple users with different compilers and setting
Next Topic:Open Declaration is slow?
Goto Forum:
  


Current Time: Wed Jun 04 11:35:41 EDT 2025

Powered by FUDForum. Page generated in 0.02882 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top