OTL 2.0 -- Cannot build examples!
Date: Wed, 21 Apr 1999 16:16:59 GMT
Message-ID: <7fktll$a0v$1_at_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/demold: fatal: Symbol referencing errors. No output written to cdemo6
-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
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:
- I can compile any Oracle OCI demos in $(ORACLE_HOME)/rdbms/demo
- 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
- I can remove the otl_connect::otl_initialize() method call and the program compiles and runs correctly.
Questions:
- Is my environment missing OCI libraries? I would appear not since I am using the same makefile as the Oracle demos.
- Is this a problem with the example1 code?
- 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 - 18:16:59 CEST
