By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,478 Members | 1,703 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,478 IT Pros & Developers. It's quick & easy.

AIX JNI Link with G++ module Problem

P: n/a
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

Jul 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
chriskr7 wrote:
[..]
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 either in an AIX newsgroup or in Java newsgroup. This is not
a C++ language problem.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.