[395] in java-interest

home help back first fref pref prev next nref lref last post

Java and C++

daemon@ATHENA.MIT.EDU (Jason Weiler)
Mon Jun 19 19:34:36 1995

Date: Mon, 19 Jun 1995 16:15:19 -0700
From: weilerj@std.teradyne.com (Jason Weiler)
To: java-interest@java.sun.com
Cc: sandersd@std.teradyne.com, craigr@std.teradyne.com,
        weilerj@std.teradyne.com

Hello all,

In a recent project, we have run into alot of trouble using C++ with java.
The error message we keep getting is:

> java AddWave
ld.so.1: /net/se/pd/pkg/hotjava/bin/../bin/sun4/java: fatal: relocation error: symbol not found: cout: referenced in /u/sandersd/ig-src/x3.0/intern/wdb/9xx/x/bin/sparc-gpic/libaddwave.so (/u/sandersd/ig-src/x3.0/intern/wdb/9xx/x/bin/sparc-gpic/libaddwave.so)
java.lang.UnsatisfiedLinkException no addwave in LD_LIBRARY_PATH
        at java.lang.Exception.<init>(Exception.java)
        at java.lang.UnsatisfiedLinkException.<init>(UnsatisfiedLinkException.java)
        at java.util.Linker.loadLibrary(Linker.java)
        at AddWave.main(AddWave.java:31)

libaddwave.so resides in:
/u/sandersd/ig-src/x3.0/intern/wdb/9xx/x/bin/sparc-gpic

and LD_LIBRARY_PATH is set to:
/usr/lib:/u/sandersd/ig-src/x3.0/intern/wdb/9xx/x/bin/sparc-gpic:/usr/openwin/lib

>From the error, we gathered that java couldn't find the C++ library on it's own, so we tried explicitly linking
libC.so from the java code both before and after we link libaddwave.so.

Is there a resaon that java can't call C++ code directly? If there is, do you know of a work-around?
If you need any other info, I'd be happy to provide it. Any help would be greatly appreciated.

I've heard that it may be because C++ is mutilating the function names in the 
library to deal with overloading and such, is there a way I can get at the exact
function names as they appear in the library?

Thanks,
Jason Weiler
<weilerj@std.teradyne.com>

PS - this message was previously sent directly to java@java.sun.com, but they
referred me to you.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post