Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

891757May 11 2015 — edited May 11 2015

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.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 8 2015
Added on May 11 2015
0 comments
1,853 views