JNI with embedded C++

J

james d.

Has anyone had any experience with this? I use MS Embedded Vis. C++ to
produce a .dll file (that I then attempt to load using JNI) however all I
get is errors.

ANY help would be appreciated.


C:\Program Files\Microsoft eMbedded C++
4.0\Common\EVC\MyProjects\HelloWorld>java HelloWorld
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program
Files\Microsoft eMbedded C++
4.0\Common\EVC\MyProjects\HelloWorld\HelloWorld.dll: Can't find dependent
libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at HelloWorld.<clinit>(HelloWorld.java:6)
 
R

Roedy Green

I use MS Embedded Vis. C++ to
produce a .dll file (that I then attempt to load using JNI) however all I
get is errors.

ANY help would be appreciated.
see http://mindprod.com/jgloss/jni.html

JNI is the tenth leading cause of premature baldness in North America.
The biggest tip I can give you is to get your C++ stuff debugged with
a standalone C++ test harness before you start hooking up the JNI.
Do everything a tiny bit at a time, and then test.

One alternative is to hire masochists who will do this sort of thing
for money. Hint hint.
 
J

james d.

Actually, this helps alot. The lack of support for JNI out there is
amazing... If you can help with my next question, it would be much
appreciated.

When I use MS Embedded Visual C++ to build my .dll (WCE Dynamic-Link
Library), I have the option to create a .lib file. What does the .lib file
do and is it necessary to have when executing my .dll?

Thank again,
James
 
C

Chris Uppal

james said:
When I use MS Embedded Visual C++ to build my .dll (WCE Dynamic-Link
Library), I have the option to create a .lib file. What does the .lib
file do and is it necessary to have when executing my .dll?

For your purposes it can be ignored.

It's just a stub *static* library that internally links to the dynamic library,
the idea is that another C(ish) program can be statically linked with the stub
so that the program uses the DLL without the programmer having to code for
loading it and finding the entrypoints at runtime.

The Java runtime knows all about dynamic loading of DLLs so the .lib file is
irrelevant for JNI users.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

JNI UnsatisfiedLinkError 11
JNI Programming 19
JNI on Redhat Linux 4
Creating .dll for JNI -- Common Error? 1
JNI (Java - C++) 3
JNI question 1
JNI java.lang.UnsatisfiedLinkError with found DLL 5
JNI Problem 3

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top