dB connection c++ with oracle using OCCI at linux

rahulonly4u's Avatar, Join Date: Sep 2010
Go4Expert Member
HI i wana connect my c++ application with oracle running on linux platform i am using OCCI library for this and my environment variables are set poerly i have writen follwoing gode for this but i am geeting following eroor msg at the time of compilation-----

/home/oracle/NetBeansProjects/TrialCppApp/main.cpp:29: undefined reference to `oracle::occi::Environment::createEnvironment(orac le::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'


I AM USINT NetBens IDE how to add locci and

Code:
#include <cstdlib>
#include <iostream>
#include<occi.h>

# define  NO_OF_LOBS 10
using namespace oracle::occi;
using oracle::occi::Environment;
using oracle::occi::Connection;
using namespace std;
/*
 * 
 */
int main(int argc, char** argv) {

    Environment* env;
    Connection *conn;
    string username;
    string password;
    string databse;

    try{
env = Environment::createEnvironment(Environment::DEFAULT);  //stmt causing error              

    }catch(oracle::occi::SQLException &e)
    {
     cout<<"Error in sql ";
    }
    cout<<"hi";
    return 0;
}
please tell me where i am doing mistake

Thanks and Regards

Last edited by rahulonly4u; 1Mar2011 at 11:36.. Reason: Code blocks
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Pleez lern tu spel. Yore messij iz verchoowully uncomrihencubbubble.

Thic eroooooor meenz yoov mist owt a laibury frum yuz link laiyn. Wear yu invowc teh lyncuh, yow knead tu ad a "-locci" oar juct a refruns tu libocci.a if yu ulridy av het dairekturi spesifeyed wiv a -L.
light_haui's Avatar, Join Date: May 2011
Newbie Member
you use window or linux
download 2 file for linux
1.instantclient-basic-linux32-11.2.0.2.0.zip
2.instantclient-sdk-linux32-11.2.0.2.0.zip

unzar to folder .
netbean \project \properties\c++ compiler add directory to folder unzar two file .instantclient-basic-linux32-11.2.0.2.0.zip
2.instantclient-sdk-linux32-11.2.0.2.0.zip
to sdk/include add file.h
goto tag linker/libraries add 4 file .so libocci ,liboieci,lnsth,nnzz
on tag linke /add libraries directory to folder unzar two file installclien