AIX JNI Link with G++ module Problem

C

chriskr7

Hi, I changed C source to C++ source and compiled with g++.

The output file is .so module which java source calls JNI native
function in the

source.

However, when aix server restart and try to call native funtion, there
is the error

like this : java.lang.UnsatisfiedLinkError. and... when I try
again, the error

changes to java.lang.NoClassDefFoundError.

My c++ source code are fully tested except for JNI related function
calls.

Is there something wrong with this jni part or :



jint iPathSize = env->GetArrayLength(savepath);
jint iNameSize = env->GetArrayLength(filename);
jint iSourceSize = env->GetArrayLength(source);
jbyte * aSavePath = env->GetByteArrayElements(savepath, 0);
jbyte * aFileName = env->GetByteArrayElements(filename, 0);
jbyte * aSource = env->GetByteArrayElements(source, 0);

//....do some stuffs

env->ReleaseByteArrayElements(savepath, aSavePath, 0);
env->ReleaseByteArrayElements(filename, aFileName, 0);
env->ReleaseByteArrayElements(source, aSource, 0);



is there something I should set in java for using c++ jni function?

please help me T.T any ideas?

enviroment: AIX 5.1 gcc 4.0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top