我在cenos4.6上装了oracle10.2, oracle的安装目录为
oracle 用户.bash_profile的配置内容如下:
     PATH=$PATH:$HOME/bin
     export PATH
     unset USERNAME
     export ORACLE_BASE=/u01/app/oracle
     export ORACLE_HOME=$ORACLE_BASE/10.2.0/db_1
     export ORACLE_SID=orcl
     export PATH=$PATH:$ORACLE_HOME/bin
     export LANG=en_US
/etc/profile配置文件的内容如下:
     export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
在/u01/app/oracle/10.2.0/db_1/lib 目录下有libocci.so.10.1 ... 等文件
在/u01/app/oracle/10.2.0/db_1/rdbms/public/目录下有 occi.h ...等头文件
我用  ln -s  /u01/app/oracle/10.2.0/db_1/rdbms/public/   /usr/locl/includ 建了一个连接写了一个类,头文件如下:
#ifndef COCCIDB_H_
#define COCCIDB_H_
#include <string>
#include <iostream>
#include  "occi/occi.h"
#include  "occi/occiCommon.h"
#include  "occi/occiData.h"
#include  "occi/occiObjects.h"
#include  "occi/occiAQ.h"
#include  "occi/occiControl.h"
using namespace oracle::occi;
using namespace std;
namespace gateway {
class COcciDb {
public:
COcciDb();
COcciDb(string usr, string passwd, string db);
virtual ~COcciDb();
static COcciDb* getInstance(string usr, string passwd, string db);
int getConnectCount(){ return _Instance->count; };
Connection* getConnect(){ count++;return _Instance->conn; };
private:
static COcciDb* _Instance;
static int count;
Environment *env;
Connection *conn;
};}#endif /* COCCIDB_H_ */
想编译一下这个类,报一大堆错:/usr/include/occi/occiAQ.h:322: error: expected `;' before '*' token
/usr/include/occi/occiAQ.h:344: error: expected `;' before '*' token
/usr/include/occi/occiAQ.h:345: error: `ub4' does not name a type
/usr/include/occi/occiAQ.h:349: error: `ub4' has not been declared
/usr/include/occi/occiAQ.h:350: error: `ub4' has not been declared
In file included from ../src/comm/oracle/COcciAccessor.h:17,
                 from ../src/comm/oracle/COcciAccessor.cpp:8:
/usr/include/occi/occiControl.h:183: error: `OCI_ATTR_PTYPE' was not declared in this scope
/usr/include/occi/occiControl.h:183: error: enumerator value for `ATTR_PTYPE' not integer constant
/usr/include/occi/occiControl.h:184: error: `OCI_ATTR_TIMESTAMP' was not declared in this scope
/usr/include/occi/occiControl.h:184: error: enumerator value for `ATTR_TIMESTAMP' not integer constant
/usr/include/occi/occiControl.h:185: error: `OCI_ATTR_OBJ_ID' was not declared in this scope
/usr/include/occi/occiControl.h:185: error: enumerator value for `ATTR_OBJ_ID' not integer constant
/usr/include/occi/occiControl.h:186: error: `OCI_ATTR_OBJ_NAME' was not declared in this scope
/usr/include/occi/occiControl.h:186: error: enumerator value for `ATTR_OBJ_NAME' not integer constant
/usr/include/occi/occiControl.h:187: error: `OCI_ATTR_OBJ_SCHEMA' was not declared in this scope
/usr/include/occi/occiControl.h:187: error: enumerator value for `ATTR_OBJ_SCHEMA' not integer constant
/usr/include/occi/occiControl.h:188: error: `OCI_ATTR_OBJID' was not declared in this scope
/usr/include/occi/occiControl.h:188: error: enumerator value for `ATTR_OBJID' not integer constant
/usr/include/occi/occiControl.h:189: error: `OCI_ATTR_NUM_COLS' was not declared in this scope
/usr/include/occi/occiControl.h:189: error: enumerator value for `ATTR_NUM_COLS' not integer constant
/usr/include/occi/occiControl.h:190: error: `OCI_ATTR_LIST_COLUMNS' was not declared in this scope
/usr/include/occi/occiControl.h:190: error: enumerator value for `ATTR_LIST_COLUMNS' not integer constant
/usr/include/occi/occiControl.h:191: error: `OCI_ATTR_REF_TDO' was not declared in this scope
/usr/include/occi/occiControl.h:191: error: enumerator value for `ATTR_REF_TDO' not integer constant
/usr/include/occi/occiControl.h:192: error: `OCI_ATTR_IS_TEMPORARY' was not declared in this scope
/usr/include/occi/occiControl.h:192: error: enumerator value for `ATTR_IS_TEMPORARY' not integer constant
/usr/include/occi/occiControl.h:193: error: `OCI_ATTR_IS_TYPED' was not declared in this scope
/usr/include/occi/occiControl.h:193: error: enumerator value for `ATTR_IS_TYPED' not integer constant
/usr/include/occi/occiControl.h:194: error: `OCI_ATTR_DURATION' was not declared in this scope
/usr/include/occi/occiControl.h:194: error: enumerator value for `ATTR_DURATION' not integer constant
/usr/include/occi/occiControl.h:195: error: `OCI_ATTR_COLLECTION_ELEMENT' was not declared in this scope
/usr/include/occi/occiControl.h:195: error: enumerator value for `ATTR_COLLECTION_ELEMENT' not integer constant
/usr/include/occi/occiControl.h:196: error: `OCI_ATTR_RDBA' was not declared in this scope
/usr/include/occi/occiControl.h:196: error: enumerator value for `ATTR_RDBA' not integer constant
/usr/include/occi/occiControl.h:197: error: `OCI_ATTR_TABLESPACE' was not declared in this scope
/usr/include/occi/occiControl.h:197: error: enumerator value for `ATTR_TABLESPACE' not integer constant
/usr/include/occi/occiControl.h:198: error: `OCI_ATTR_CLUSTERED' was not declared in this scope
/usr/include/occi/occiControl.h:198: error: enumerator value for `ATTR_CLUSTERED' not integer constant
/usr/include/occi/occiControl.h:199: error: `OCI_ATTR_PARTITIONED' was not declared in this scope
/usr/include/occi/occiControl.h:199: error: enumerator value for `ATTR_PARTITIONED' not integer constant
/usr/i

大家帮忙给看一下,我的配置哪里有问题,应该怎么做