At 10:17 02 Feb 2000 -0600, [EMAIL PROTECTED] wrote:

> Q1: I was told that when java jni loads .so file, the first function been
> called is _init().  Can I use it as a constructor to setup something when
> java app loads the .so file?  If I put _init() func in .so C source file,
> compiler generates an error msg "multiple definition of '_init',
> /usr/lib/crti.o:first definition here".

That's right, this isn't going to happen - find another way.

One suggestion is to use a C++ object constructor (singleton style).  Another
is to wait until the JVM calls your DLL and to do your work there.

_init is used by the C compiler to do it's own initialisation - you can't
provide your own implementation of it unless you don't link against the c
runtime library (which you probably want to do)

> Q2: After java jni loads a .so file, how can I find the number of links to
> the .so file from a command line command and a lib call?

huh?

Paul


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to