Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNI with embedded C++

Reply
Thread Tools

JNI with embedded C++

 
 
james d.
Guest
Posts: n/a
 
      10-16-2003
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.dl l: Can't find dependent
libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1473)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1397)
at java.lang.Runtime.loadLibrary0(Runtime.java:78
at java.lang.System.loadLibrary(System.java:832)
at HelloWorld.<clinit>(HelloWorld.java:6)


 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-16-2003
On Wed, 15 Oct 2003 23:45:21 -0400, "james d." <(E-Mail Removed)>
wrote or quoted :

> 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.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
james d.
Guest
Posts: n/a
 
      10-16-2003
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


"Roedy Green" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Wed, 15 Oct 2003 23:45:21 -0400, "james d." <(E-Mail Removed)>
> wrote or quoted :
>
> > 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.
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



 
Reply With Quote
 
Millian Brave
Guest
Posts: n/a
 
      10-16-2003
Pssst: http://www.codeproject.com/useritems...asp?target=JNI

Also do a search at code project for other articles on the same subject.

---
Regards,
Millian Brave <(E-Mail Removed)>


"james d." <(E-Mail Removed)> skrev i melding
news:bml49c$mvt$(E-Mail Removed)...
> 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.dl l: Can't find dependent
> libraries
> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1473)
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1397)
> at java.lang.Runtime.loadLibrary0(Runtime.java:78
> at java.lang.System.loadLibrary(System.java:832)
> at HelloWorld.<clinit>(HelloWorld.java:6)
>
>



 
Reply With Quote
 
Chris Uppal
Guest
Posts: n/a
 
      10-17-2003
james d. wrote:

> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JNI thread vs. native thread vs. JNI call bgabrhelik Java 0 09-29-2009 03:33 PM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:03 AM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:01 AM
Porting JNI Windows under JNI LINUX + Wine ? Pasturel Jean-Louis Java 5 03-03-2004 07:50 PM
IBM's JNI fails where Sun's JNI works Alex Hunsley Java 4 11-04-2003 10:34 AM



Advertisments