Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle DB Connectivity through OCI and C++
Sorry for the re-post. I forgot the subject on the last post.
Hello all.
We are trying to implement some C++ programs using OCI to access an Oracle Database. However we are having trouble during the linking stage. Before I ask for too much help, I would just like some suggestions as to which libraries the following are in. Below is posted the output of the compilation/linking of our program.
Below the Errors is our C++ code.
If anyone has had any luck working with OCI, and/or gcc/g++ I would appreciate any insight you may be able to through our way.
Thanks,
Darren
--------------Errors----------------- bart:/users/drgreer/c/oracle =>make -f oracle.mk test1 /opt/gcc/bin/g++ -O test1.cc -L/usr/oracle/7.3.4/lib-L/usr/oracle/7.3.4/rdbms/lib -o test1
oerhms (code)
obndra (code)
oopen (code)
oparse (code) obndrv (code) ologof (code)
Stop.
#include <iostream.h> #include <stdio.h> #include <otl7.h>
otl_connect db;
void select() {
char f1[256];
otl_stream oraclestream (256
// buffer size
,"select * from v$database"
//select sql statement
,db);
cout << endl;
while (!oraclestream.eof()){ oraclestream>>f1; cout<<"f1="<<f1<<endl; } cout << endl;
//---------------------------------------------
int main() {
otl_connect::otl_initialize();
// init OCI environment
try { db.rlogon("login/password");
select(); } catch(otl_exception& p) {
// intercept OTL exceptions
cerr<<p.msg<<endl; if (p.stm_text) cerr<<p.stm_text<<endl;
// print offending sql
} db.logoff(); return 0;
![]() |
![]() |