tags:

views:

103

answers:

2

Hi All , I have written one sample program for connecting Oracle in C++ using OCCI..

It is giving me a runtime error .

ld: 0711-317 ERROR: Undefined symbol: .oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode,void*,void*(*)(void*,unsigned long),void*(*)(void*,void*,unsigned long),void(*)(void*,void*))
ld: 0711-317 ERROR: Undefined symbol: .oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)

I have given the following command to execute it

g++ -o occi amrtest.cpp -Wall -I/oradata/oracle/product/10.2.0/db_1/rdbms/public -L/oradata/oracle/product/10.2.0/db_1/lib -lclntsh  -lnnz10 -locci -lclntsh  -lnnz10 -locci10

Can u help me in getting this error resolved ?

+1  A: 

I am not an AIX nor Oracle expert, but seems that your LD_LIBRARY_PATH (or equivalent in AIX) should include $ORACLE_HOME/lib. Check this forum entries:

http://forums.oracle.com/forums/thread.jspa?messageID=2172885
http://forums.oracle.com/forums/thread.jspa?threadID=579418&tstart=0
http://www.dbforums.com/oracle/1007236-occi-aix-oracle-9-a.html

HTH.

jrbjazz
A: 

Hey thanks for your feedback , I checked my Oracle lib file , That file was missing the definitions for the createEnvironment and TerminateEnvironment. So i downloaded the latest lib from Oracle site and then it worked properly :)

Amrish