Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem Linking Pro*C apps on a RedHat 5.2 Machine

Re: Problem Linking Pro*C apps on a RedHat 5.2 Machine

From: Andreas Vef <avf_at_gft.de>
Date: Tue, 20 Apr 1999 12:20:08 +0200
Message-ID: <371C54D8.2686@gft.de>


Hi Chuck,

Using OCI I had the same problem with slpmprodstab (Oracle 8 on Linux 6.0 / Suse)
Linking the OCI samples with the makefile in rdbms/demo used the following
list of libraries - probably a subset is sufficient

# hard to believe, but these are the libraries used to build the SHARED # version of the oracle driver on linux...!!!

  $(HOMEORA80)/rdbms/lib/defopt.o $(HOMEORA80)/lib/sscoreed.o \
  $(HOMEORA80)/lib/libclntsh.so $(HOMEORA80)/lib/nautab.o \
  $(HOMEORA80)/lib/naeet.o $(HOMEORA80)/lib/naect.o
$(HOMEORA80)/lib/naedhs.o \
  -lnetv2 -lnttcp -lnetwork -lncr -lclient -lvsn -lcommon -lgeneric -lmm \
  -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2 -lnttcp -lnetwork \
  -lncr -lclient -lvsn -lcommon -lgeneric -lepc -lnlsrtl3 -lcore4 -lnlsrtl3 \
  -lcore4 -lnlsrtl3 -lclient -lvsn -lcommon -lgeneric -lnlsrtl3 -lcore4 \
  -lnlsrtl3 -lcore4 -lnlsrtl3 -lnsl -lm -ldl -lm -ldl -lnetv2 -lnttcp \   -lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork \
  -lncr -lnetv2 -lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lncr \
  -lsql -lsql

        Andreas

Chuck wrote:
>
> On Sat, 17 Apr 1999 16:06:50 +0200, Uwe Schneider
> <pi_at_nospam.richard-schneider.de> wrote:
>
> I included all the libraries you listed and still get some
> undefined's. Here is what the compiler says now:
>
> /usr/local/oracle/app/oracle/product/8.0.5/lib/libclntsh.so: undefined
> reference to `slpmprodstab'
>
> Any ideas?
>
> >Hi Chuck,
> >
> >Chuck wrote:
> >>
> >> I am new to Pro*C and Oracle development and I am trying to
> >> develop some simple applications that query my 805 database
> >> running on a RedHat 5.0.2 machine.
> >>
> >> The code precompiles without any problems using Oracle's
> >> precompiler, proc.
> >>
> >> I then try and compile the resulting source file with GCC
> >> 2.7.2.3 and get complaints about undefined references which
> >> I am sure are caused by a library I am not linking. I have
> >> tried linking just about every library in the Oracle lib
> >> directories to no avail.
> >>
> >> What would be the exact syntax I would use to link this library
> >> during compile time? Also, I have collected nearly every piece
> >> of Oracle documentation I can find and everything refers to this
> >> library as LIBSQL. I am no stranger to linking libraries and using
> >> the GCC compiler, but the answer to this eludes me.
> >
> >there are example Makefiles provided with Oracle 8.05/Pro*C. Look at
> >them for a first approach. They link the objects against a lot of
> >(repeating) libraries.
> >
> >After experimenting for a while I found out the minimal set of libraries
> >and object files to be included with simple Pro*C programs. My Makefile
> >contains the following statement:
> >
> >ORALIB=$(ORACLE_HOME)/lib
> >
> >ORA_LDFLAGS=-L$(ORALIB) \
> > $(ORALIB)/scorept.o \
> > $(ORACLE_HOME)/rdbms/lib/kpudfo.o \
> > -lclntsh \
> > -lclient \
> > -lcore4 \
> > -lnlsrtl3 \
> > -lnetv2
> >
> >LDFLAGS = $(ORA_LDFLAGS) -ldl -lm
> >
> >sample1: sample1.o
> > $(CC) -o $@ $< $(LDFLAGS)
> >
> >This should be appropriate for you although I do use SuSE Linux.
> >
> >Uwe
> >--
> >Uwe Schneider | Telefon +49 7251 / 82587
> >Karlsdorfer Str. 31 | Mail pi_at_richard-schneider.de
> >DE-76646 Bruchsal |
> >Linux - OS al dente!

--


Dr. Andreas Vef                            mailto:Andreas.Vef_at_gft.de
Software-Entwicklung                       Tel: ++49/7724/9411-0
GFT Technologies AG                        Fax: ++49/7724/9411-94
Leopoldstr. 1                              http://www.gft.de 
78112 St. Georgen                          Germany
Received on Tue Apr 20 1999 - 05:20:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US