GCJ and C++ (calling Java from C++)

Lothar Werzinger lothar@tradescape.biz
Thu Dec 8 18:27:00 GMT 2005


On Thursday 08 December 2005 09:37, Andrew Haley wrote:
> OK, I found the problem, and it's a weird one.
>
> Basically, calling code linked -Bsymbolic from non-PIC code is
> impossible.  An explanation is attached.
>
> I can make your test run by compiling absolutely *everything*,
> including your executable, with -fPIC.  This causes
> org::eclipse::emf::examples::extlibrary::Library::class$ to be
> resolved in the library where it belongs instead of being copied to
> the executable.
>
> We need to add a note to this effect the CNI manual pages.
>
> Andrew.

Great, thanks. I added -fPIC as you did and everything went fine.
I tried so many combinations with and without -findirect-dispatch and with and 
without -fjni which all had more problems. I never thought about the 
-Wl,-Bsymbolic -fPIC line which I copied from the classpath wiki where it 
expalins how to compile a native eclipse.

Thanks for the good work!

Lothar
-- 
Lothar Werzinger Dipl.-Ing. Univ.
framework & platform architect
Tradescape Inc.
111 West St. John Street, Suite 200
San Jose, Ca 95113
email: lothar@tradescape.biz



More information about the Java mailing list