Cannot load shared library from Java on AIX
I am working on a 64-bit AIX5.2 machine. I created a hello world program using JNI. When I run it, System.loadLibrary() does not find my shared library. After looking into it for several hours, I realized it might be something to do with my 32 bit mode build. The reason I am building as 32 bit is because I thought it would work on both 32 and 64 bit platforms.
This is how I compile my C++ file and build the shared library:
xlC_r -brtl -q32 -c -I"." -I"/usr/java5_64/include" -c NativeHello.cpp -o NativeHello.o
xlC_r -brtl -G -q32 -o libNativeHello.so NativeHello.o
When I run my HelloWorld java program, it gives this error:
java.lang.UnsatisfiedLinkError: NativeHello (A file or directory in the path name does not exist.)
However, when I change the build lines to use -q64 instead of -q32, my hello world program works just fine.
So I am suspecting that Java is not expecting my shared library that was compiled as 32 bit.
How can I correct this problem? Is there any flag that I might be missing? Or do I need to build separate libraries for 32 bit and 64 bit environment?
Thanks for your help in advance.

