Making shared objects with GCJ

Bryce McKinlay mckinlay@redhat.com
Fri May 21 14:31:00 GMT 2004


Sal wrote:
>I'm trying to build a shared object (.so, .dll) with GCJ. The purpose is
>to make libraries for projects to use from any language. I understand
>that making .dlls on windows may not work yet, so .so will be fine for me
>for the interim (I may try to cross compile later on).
>>I'm wondering is this currently possible? I know GCJ can generate .so
>files, however the exported symbols are mangled, and you need CNI, or some
>library to interoperate with them properly. I'm wondering if it would be
>possible to make a .so with 'friendly' exported symbols that can easily be
>used in any compiler that can load symbols from a .so.
>>
You would do this by writing a connecting layer in C++ or C which 
exposes your library API as extern "C" functions. These glue functions 
would then call into your java code using CNI or JNI and the invocation 
APIs.
Regards
Bryce


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /