hi to all, i am using cntos7.5 as client and centos 6.10 as oracle 11gR2 server both in VM. I am trying to build a c++ program in which i called occi call interface. but having this error.
opt/oracle/instantclient_11_2/sdk/include/occiControl.h|986|error: expected identifier before ‘int’|
/opt/oracle/instantclient_11_2/sdk/include/occiControl.h|987|error: expected unqualified-id before ‘{’ token|
/opt/projects/codeblocks/c++/cbs/cbs/src/product_record.cpp|16|warning: unused variable ‘stmt’ [-Wunused-variable]|
/opt/oracle/instantclient_11_2/sdk/include/occiControl.h|1257|error: expected identifier before ‘int’|
/opt/oracle/instantclient_11_2/sdk/include/occiControl.h|1258|error: expected unqualified-id before ‘{’ token|
/opt/oracle/instantclient_11_2/sdk/include/occiControl.h|1387|error: expected identifier before ‘int’|
/opt/oracle/instantclient_11_2/sdk/include/occiControl.h|1387|error: expected unqualified-id before ‘{’ token|
source code is :-
product_record.h:-
#ifndef PRODUCT_RECORD_H
#define PRODUCT_RECORD_H
#include <string>
#include <occiControl.h>
#include <occi.h>
#include <string>
using namespace std;
using namespace oracle::occi;
class product_record
{
public:
product_record();
virtual ~product_record();
product_record(const product_record& other);
product_record& operator=(const product_record& other);
void product_Enter();
void read_Product();
void modify_Product();
protected:
private:
Environment *env;
Connection *conn;
Statement *stmt;
string strstmt;
};
#endif // PRODUCT_RECORD_H
product_record.cpp
#include "product_record.h"
using namespace oracle::occi;
using namespace std;
product_record::product_record()
{
//ctor
const string user="rahul", passwd = "rahul", connstring = "orcl";
env = Environment::createEnvironment();
conn = env->createConnection(user, passwd, connstring);
Statement *stmt = conn->createStatement(strstmt);
}
product_record::~product_record()
{
//dtor
conn->terminateStatement(stmt);
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
}
product_record::product_record(const product_record& other)
{
//copy ctor
}
product_record& product_record::operator=(const product_record& rhs)
{
if (this == &rhs) return *this; // handle self assignment
//assignment operator
return *this;
}
void product_record::product_Enter()
{
stmt = conn->createStatement(strstmt);
}
void product_record::read_Product()
{
}
void product_record::modify_Product()
{
}
how to recover this error.