0
votes

I compiled my Proc*C code on Red Hat Enterprise Linux Server release 6.0 (Santiago) with Oracle 12C setup. It was working fine . When I migrated the same executable to another server with Oracle 11G set up , I get this issue "libclntsh.so.12.1: cannot open shared object file." I have properly exported ORACLE_HOME and LD_LIBRARY_PATH in .bash_profile.

On running ldd command I get - libclntsh.so.12.1 => not found

My makefile compilation for the exe is :

gcc -o libexceptiondal.so -shared -Wl /oradata1/JSEDev/Application/Source/Dal/Objects/Abc.o -L. -L/usr/lib64 -lstdc++ -L/oracle/ora12cu/app/ora12cu/product/12.1.0/dbhome_1/lib -lclntsh -L/oradata1/JSEDev/Application/Lib -lLog4Cpp2

Now can anyone tell me why the exe is looking for libclntsh.so.12.1 when while compiling I never mentioned the version of libclntsh.so library. How can I make my exe oracle version independent . Can anyone please shed some light on this.

1

1 Answers

0
votes

Did you look at libclntsh.so? It's a symlink to the specific version.

When you use the Oracle 12c or 11g client libraries, you need to have those libraries present on any system you run the executable on. If you're dynamically linking, you need to copy the client libraries - most people just install the same Oracle client version on all their machines.

Possibly you want to statically link the Oracle 12c client library into your application? I've never tried it; it's apparently tedious but possible.