Paul Beardsley wrote:
> I used "ldd -r libmylib.so" to look at my shared
> library and that also gave a list
> of undefined symbols, starting with the
> same symbol which Java lists as an unsatisfied link.
And what might that symbol (or some of those symbols) be? That info
would help diagnose the problem.
I've successfully built native components using the C++ STL and
templated classes, so there doesn't seem to be a generic template
problem here. My steps were:
g++ -D_REENTRANT -fpic -c ...flags and files...
g++ -shared -o lib...
and I'm using the g++ environment shipped with RH6.0.
Nathan
>
> I just started working on Redhat 6.0 using
> jdk 1.2, and I would like to use a Java GUI
> linked to a C++ .so library (compiled with g++),
> communicating via the JNI.
>
> I successfully linked the Java GUI to the C++ library
> when no templates were used, but now I am linking to
> C++ classes which are templates, and I am getting
> unsatisfied link errors for the templated methods.
>
> I used "ldd -r libmylib.so" to look at my shared
> library and that also gave a list
> of undefined symbols, starting with the
> same symbol which Java lists as an unsatisfied link.
>
> So I guess I am not compiling the shared library
> with the correct compiler options. My link
> looks like this -
>
> g++ -shared File1.o ... FileN.o -o libVl.so
>
> I tried including -lc but that was no help.
> Can anyone tell me how to build this C++ shared
> library so it works with Java?
>
> Thanks a lot,
> Paul.
>
> ---------------------------------------------------------------------------
> Paul Beardsley email: [EMAIL PROTECTED]
> MERL - A Mitsubishi Electric Research Laboratory, tel: +(617) 621 7569
> 201 Broadway, Cambridge, MA 02139, USA fax: +(617) 621 7550
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]