Forum Stats

  • 3,769,513 Users
  • 2,252,970 Discussions
  • 7,875,068 Comments

Discussions

undefined reference to `oracle::occi::Environment::createEnvironment

891757
891757 Member Posts: 8
edited May 11, 2015 11:12PM in Oracle Call Interface (OCI)

hello to all,

                    I've centos7 and Qt5.3.2 with oracle 11gr2( database is fine installed ). I'm very new to OCI. I was running

following program :-

#include <QApplication>
#include <iostream>
#include <occi.h>
#include <string>
#include <sys/types.h>

using namespace std;
using namespace oracle::occi;
//using namespace oracle::occi::aq;

const string userName = "scott";
const string password = "tiger";
const string connectString = "";

int main()
{
   QApplication app(argc, argv);

    Environment *env = Environment::createEnvironment();//Environment::OBJECT);
Connection *conn = env->createConnection(
userName, password, connectString);
Statement *stmt = conn->createStatement(
"SELECT ename FROM emp");
ResultSet *rs = stmt->executeQuery();
rs->next();
string name = rs->getCharSet(1);

cout << "ename : " << name << endl;

stmt->closeResultSet(rs);
conn->terminateStatement(stmt);
env->terminateConnection(conn);

Environment::terminateEnvironment(env);
return app.exec();
}


and hangup with this error :- undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned long), void* (*)(void*, void*, unsigned long), void (*)(void*, void*))'

why compiler doesn't recognize "Environment::createEnvironment"

how to solve this problem.

Tagged:
This discussion has been closed.