I need help. I have trouble whit OCCI. Where make I the defect ??
[Linker error] undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::E nvironment::Mode, void, void ()(void, unsigned), void ()(void, void, unsigned), void ()(void, void*))'
using namespace oracle::occi; using namespace std;
int main(int argc,char argv[]) { bool b; Environment env = Environment::createEnvironment(); try { Connection conn = env->createConnection("xxx","xxx","xxx"); Statement stmt = conn->createStatement("select bool from tbool"); ResultSet* rset = stmt->executeQuery(); rset->setDataBuffer(1,&b,OCCIINT,siz eof(bool)); while (rset->next()) { if (b) cout << "bool was true" << endl; else cout << "bool was false" << endl; } stmt->closeResultSet(rset); conn->terminateS tatement(stmt); env->terminateConnection(conn); } ca tch (SQLException e) { cout << e.what() << endl; } Environment::terminateEnvironment(env); retu rn 0; }
Log in to post a comment.
I need help. I have trouble whit OCCI.
Where make I the defect ??
[Linker error] undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::E nvironment::Mode, void, void ()(void, unsigned), void ()(void, void, unsigned), void ()(void, void*))'
include
include
include
using namespace oracle::occi;
using namespace std;
int main(int argc,char argv[])
{
bool b;
Environment env = Environment::createEnvironment();
try
{
Connection conn = env->createConnection("xxx","xxx","xxx");
Statement stmt = conn->createStatement("select bool from tbool");
ResultSet* rset = stmt->executeQuery();
rset->setDataBuffer(1,&b,OCCIINT,siz eof(bool));
while (rset->next())
{
if (b) cout << "bool was true" << endl;
else cout << "bool was false" << endl;
}
stmt->closeResultSet(rset);
conn->terminateS tatement(stmt);
env->terminateConnection(conn);
}
ca tch (SQLException e)
{
cout << e.what() << endl;
}
Environment::terminateEnvironment(env);
retu rn 0;
}