Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   dB connection c++ with oracle using OCCI at linux (http://www.go4expert.com/forums/db-connection-cpp-oracle-using-occi-t25106/)

rahulonly4u 1Mar2011 10:11

dB connection c++ with oracle using OCCI at linux
 
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

xpi0t0s 1Mar2011 18:32

Re: dB connection c++ with oracle using OCCI at linux
 
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 11May2011 10:25

Re: dB connection c++ with oracle using OCCI at linux
 
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


All times are GMT +5.5. The time now is 08:15.