Re: Hello world program loads unused Oracle SO libraries



herbert koelman <herbert.koelman@xxxxxxxx> writes:

kermit wrote:
On Wed, 01 Nov 2006 13:40:43 +0100, herbert koelman wrote:

I've written the classic hello.c (the one that says hello world).

I used a makefile that builds programs to run against Oracle using
OCCI. So make runs this command:
cc -I
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/
-g -D_REENTRANT -I
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/
-g
-D_REENTRANT -L
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib -L
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib -locci
-lclntsh -lpthread hello.c -o hello

This produced the hello program.

So far still good. Now I run the program and obtains:
[herbert@pc-bureau src]$ ./hello herbert
./hello: error while loading shared libraries: libocci.so.10.1:
cannot open shared object file: No such file or directory

I don't understand why would the program try to load a library it
is not using !!??
... because you linked agained libocci ( -locci in your compile
flags).
Obviously for just a hello world program, you wouldn't need to link
against these

Hello there,

Do you mean that I have to set different library flags according to
what I'm about to build ?

Maybe.

Then I would need a Makefile to build hello world programs and another
one for Oracle programs ? Or is there away to handle both cases in one
makefile.

pgm1: pgm1.o ....
cc -locci -o $@
pgm2: pgm2.o ....
cc -o $@
.



Relevant Pages

  • Re: Hello world program loads unused Oracle SO libraries
    ... I used a makefile that builds programs to run against Oracle using ... cannot open shared object file: ... Do you mean that I have to set different library flags according to ...
    (alt.os.linux.redhat)
  • Re: Hello world program loads unused Oracle SO libraries
    ... ./hello: error while loading shared libraries: libocci.so.10.1: cannot open shared object file: No such file or directory ... Then I would need a Makefile to build hello world programs and another one for Oracle programs? ...
    (alt.os.linux.redhat)
  • Memory leak in DBD::Oracle 1.14 ... ?
    ... could not decode oracle version from ... t/cursor.....oracle: error while loading shared libraries: libodm9.so: cannot open shared object file: No such file or directory ... Unable to connect to Oracle as scott/tiger (ORA-12547: TNS:lost contact (DBD ERROR: OCIServerAttach)) ...
    (perl.dbi.users)
  • Re: trouble installing DBD:Oracle on linux
    ... Your Makefile run seems to be successful. ... The warning you obviously refer to only affects one way DBD::Oracle uses ... Unable to interpret Oracle build commands from ... The Makefile runs a make command and uses the output to determine the ...
    (perl.dbi.users)
  • RE: DBD::Oracle on Linux 64bit
    ... Subject: DBD::Oracle on Linux 64bit ... The Oracle client you are using is most likely not fully patched as it is missing ... But, package 1.22 didn't have file META.yml, so I've cut line "META.yml Module meta-data " in the MANIFEST and got an more or less successfully makefile. ... Oracle.h:115: error: conflicting types for 'OCIXMLTypeCreateFromSrc' ...
    (perl.dbi.users)