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

Home -> Community -> Usenet -> c.d.o.misc -> OTL 2.0 -- Cannot build examples!

OTL 2.0 -- Cannot build examples!

From: <Jeffery_Cann_at_mcgraw-hill.com>
Date: Wed, 21 Apr 1999 16:16:59 GMT
Message-ID: <7fktll$a0v$1@nnrp1.dejanews.com>

For the 2.0 version of the OTL, I am attempting to compile the examples shown on: http://home.sprynet.com/~skuchin/otl_1pg.htm in an Oracle 7.3.3 and Solaris environment. None of the four examples link due to the following error:

(NOTE: I am using the OCI demo makefile oracle.mk and am compiling the example code as the Oracle C++ OCI 'cdemo6')

   make cdemo6
   make -f oracle.mk buildc++ EXE=cdemo6 OBJS=cdemo6.o    make[1]: Entering directory `/dvlp/fi/jccann/c++/OTL/otl-ex.2.0'

   g++ -c -I/ora/app/oracle/product/7.3.3/rdbms/demo

-I/ora/app/oracle/product/7.3.3/rdbms/public -I. cdemo6.cc
g++ -L/ora/app/oracle/product/7.3.3/lib
-L/ora/app/oracle/product/7.3.3/rdbms/lib -o cdemo6 cdemo6.o
/ora/app/oracle/product/7.3.3/lib/libclient.a -lsqlnet -lncr -lsqlnet
-lclient -lcommon -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon
-lgeneric -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3
-lsocket -lnsl -lm -ldl -lposix4 -lsunmath -lm -lcore3
Undefined first referenced symbol in file opinit cdemo6.o
ld: fatal: Symbol referencing errors. No output written to cdemo6

Looking at otl.h (copied from otl7.h) it appears that opinit() is used to create a thread-safe connection to Oracle. It also appears that opinit() is provided by Oracle.

If I comment out the line 65 in 'example 1', the program compiles and runs correctly:

    61 // example1.cpp
    62 int main()
    63
    64 {
    65 otl_connect::otl_initialize(); // initialize OCI environment     66 try{

Given:

  1. I can compile any Oracle OCI demos in $(ORACLE_HOME)/rdbms/demo
  2. I can use the oracle.mk makefile to comple any of the OTL version 1.0 examples on http://home.sprynet.com/~skuchin/otl.htm
  3. I can remove the otl_connect::otl_initialize() method call and the program compiles and runs correctly.

Questions:

  1. Is my environment missing OCI libraries? I would appear not since I am using the same makefile as the Oracle demos.
  2. Is this a problem with the example1 code?
  3. Why can I comment out the otl_initialize() method call and still the program runs correctly?

Suggestions are appreciated
Thanks
Jeff

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Apr 21 1999 - 11:16:59 CDT

Original text of this message

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