Re: Hello world program loads unused Oracle SO libraries



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 ?

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.
.



Relevant Pages

  • 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)
  • Re: symbol lookup error for DBD-Oracle 1.19 and Oracle instantclient 10.2.0.3
    ... The header files are in /s/oracle/include, the Makefile doesn't seem to want to find them. ... Oracle version 10.2.0.3 ... Use of uninitialized value in substitution at Makefile.PL line 1333. ... WARNING: If you have problems you may need to rebuild perl with threading enabled. ...
    (perl.dbi.users)
  • DBD-Oracle fails to install
    ... got AIX 5.2 with perl 5.8.0 and Oracle Database 9.2.0 and DBI installs without notice, but DBD-Oracle aborts with som linking problems about Oracle.so ... rm -rf Makefile Makefile.old ... Using Oracle in /u01/app/oracle/product/9.2.0 ...
    (perl.dbi.users)
  • 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)