C++ executable is not loading in AIX 6.1 OS LEVEL 6100-09 with Oracle11g.

Hi Everybody,
I am getting following error message during execution of my c++ executable "ofsrm" . I am using AIX 6.1 OS LEVEL 6100-09 with Oracle 11g database. Any suggestion on the same?

Could not load program ofsrm: rtld: 0712-001 Symbol  GetOracleDriver__FiPc was referenced from module  /build1/build/SourcePro/ficdb/lib/libFSGBU/libaccess.a(libaccess.o), but  a run time definition of the symbol was not found. rtld: 0712-002 fatal  error: exiting. 

I checked my executable with ldd . It is loading all the library other than liboci.a . I have also added the corresponding path in LIB_PATH . Still same issue is coming.

Thanks,
RKS

The symbol was there when you compiled, so something is amiss in your environment. I like 'ldd -rsv' to see more detail. Google says that's '$LIBPATH' !

Hi,
Following is the sample program. Same is working in AIX6.1 OS Level 6100-04 but showing following error in the AIX 6.1 OS LEVEL 6100-09 with Oracle11g .

test.cpp

#include<iostream>
using namespace std;

int main()
{
  cout<<"Test Program."<<endl;
  return 1;
}

To Compile:

 xlC_r  -q64 -Dx64 -bbigtoc  -qnotempinc -qnoro  -g  -D_RWCONFIG_15d=1 -c  test.cpp -o test.o

To Create Executable:

xlC_r -u GetOracleDriver__FiPc -q64 -Dx64 -bbigtoc  -qnotempinc -qnoro  -D_RWCONFIG_15d=1 test.o -o testExe -L/build1/build/SourcePro/SRC/bin -liomod -L/oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib /usr/lib/libperfstat.a /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/naect.o /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/naeet.o /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/nautab.o /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/scorept.o   `cat /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lnro12 `cat /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/ldflags` -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -loraz -llzopro -lorabz2 `if [ -r /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/libnnzst12.a ] ; then echo -lnnzst12 ; else echo -lnnz12 ; fi` -lzt12 -lztkg12 -lztkg12 -lclient12 -lnnetd12  -lvsn12  -lcommon12 -lgeneric12 -lmm -lsnls12 -lnls12  -lcore12 -lsnls12  -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12  -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 `cat /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lnro12 `cat /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -loraz -llzopro -lorabz2   -lclient12 -lnnetd12  -lvsn12  -lcommon12 -lgeneric12 -lpls12  -lrt  -lsnls12 -lnls12  -lcore12 -lsnls12  -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12  -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12  -lclient12 -lnnetd12  -lvsn12  -lcommon12 -lgeneric12 -lsnls12 -lnls12  -lcore12 -lsnls12  -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12  -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12  -lld -lm -lodm  -lm   -lpthreads /oracleorg/oracle/app/oracle/product/12.1.0/client_1/lib/libons.a -L/usr/java6_64/jre/lib/ppc64/j9vm -ljvm -L/build1/build/SourcePro/ofsa3plib/RogueWave/SourcePro/Ed10/aix/64/lib -ltls8015d -lnsl  -ldl  -brtl -bloadmap:log.txt

Execution Out Put :

 ./testExe
Could not load program testExe:
rtld: 0712-001 Symbol GetOracleDriver__FiPc was referenced
      from module /build1/build/SourcePro/ficdb/lib/libFSGBU/libaccess.a(libaccess.o), but a runtime definition
            of the symbol was not found.
rtld: 0712-002 fatal error: exiting.

Regards,
RKS

What's the output from "ldd -rsv testExe"? Both from where it works and where it fails.

You were asked this once before.

$ ldd -rsv testExe
Usage: ldd [ -Llibpath ] executable
Here -rsv is not working.

Following is the ldd information of my executable.
$ ldd testExe
testExe needs:
/build1/build/SourcePro/ficdb/lib/libFSGBU/libiomod.a(libiomod.o)
/usr/lib/libperfstat.a(shr_64.o)
/usr/lib/libodm.a(shr_64.o)
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/usr/java6_64/jre/lib/ppc64/j9vm/libjvm.so
/build1/build/SourcePro/ficdb/lib/libFSGBU/libtls8015d.a(tls15d.o)
/usr/lib/libnsl.a(shr_64.o)
/usr/lib/libdl.a(shr_64.o)
/usr/vacpp/lib/libC.a(shr_64.o)
/usr/vacpp/lib/libC.a(ansi_64.o)
/usr/lib/libc.a(shr_64.o)
/usr/lib/libc.a(aio_64.o)
/build1/build/SourcePro/ficdb/lib/libFSGBU/libaccess.a(libaccess.o)
/build1/build/SourcePro/ficdb/lib/libFSGBU/libutils.a(libutils.o)
/build1/build/SourcePro/ficdb/lib/libFSGBU/libtscdbg.a(libtscdbg.o)
/build1/build/SourcePro/ficdb/lib/libFSGBU/libofsabase.a(libofsabase.o)
/build1/build/SourcePro/ficdb/lib/libFSGBU/libglbl.a(libglbl.o)
/build1/build/SourcePro/ficdb/lib/libFSGBU/libunix.a(libunix.o)
/build1/build/SourcePro/ficdb/lib/libFSGBU/librevdtl.a(librevdtl.o)
/usr/vacpp/lib/libC.a(shr2_64.o)
/usr/lib/libc_r.a(shr_64.o)
/usr/lib/libcfg.a(shr_64.o)
/unix
/usr/lib/liblvm.a(shr_64.o)
/usr/lib/libcorcfg.a(shr_64.o)
/usr/vacpp/lib/libC.a(shr3_64.o)
/usr/lib/libthread.a(shr_64.o)
/usr/lib/libtli.a(shr_64.o)
/usr/vacpp/lib/libC.a(shrcore_64.o)
/usr/vacpp/lib/libC.a(ansicore_64.o)
/usr/lib/libcrypt.a(shr_64.o)
/build1/build/SourcePro/ficdb/lib/libSms.so
/build1/build/SourcePro/ficdb/lib/libDatabase.so
/build1/build/SourcePro/ficdb/lib/libmisc.so
/build1/build/SourcePro/ficdb/lib/libicc.so
/build1/build/SourcePro/ficdb/lib/libiccsock.so
/build1/build/SourcePro/ficdb/lib/libI18N.so
/usr/lib/libsrc.a(shr_64.o)
/usr/lib/libc.a(pse_64.o)
/oracleorg/oracle/app/oracle/client_1/lib/libclntsh.so
/usr/lib/libpthread.a(shr_xpg5_64.o)
/build1/build/SourcePro/ficdb/lib/libiconv.a(shr4_64.o)

Read and heed.

-rsv option for ldd is not working. It is respecting executable name immediate after ldd. I am using AIX6.1 machine.

Apparently AIX has a very limited ldd command. However, when you compiled, all symbols were resolved. Somewhere in the compile is a full path to a library or object, or an -L option that specifices where to find dynamic objects, or a -R PATH, and you need that directory/PATH in the exported LIBPATH environment variable. The linking part of the compile is described in the ld command: IBM Knowledge Center

An additional way to debug is to use dump -H of the executable as well as the libraries.

Seeing the output of the program when it fails is also useful for debugging. You need to read the error message carefully as it tells you which member it is loading and that member cannot find a dependency - and which dependency iit is missing.

Or have you solved this already?

If so, please share your solution!

---------- Post updated at 12:33 PM ---------- Previous update was at 12:18 PM ----------

Errr... Preview threw it all away. So, short version.

ofsrm <> testExe

Based on the error message I would compare dump -H of the following files:

  • ofsrm
  • testExe
  • /build1/build/SourcePro/ficdb/lib/libFSGBU/libaccess.a

Probably, the last (the archive) does not have an accurate library search path.