致命错误:occos.h在centos6.6中没有这样的文件或目录

时间:2017-04-09 13:04:22

标签: c++ linux

我在第二个os - centos6.6(虚拟机2)中使用了VMWARE 12,centos6.6(虚拟机1)和oracle11gr2服务器。我试图在客户端机器中连接C ++,在服务器中连接oracle11gr2。问题在于我的cpp代码

enter code here

 #include <iostream>
 #include <occi.h> // here "oracle/11.2/client/occi.h" shows by editor codeBlocks but can not detects this.

  using namespace std;

int main(){

 oracle::occi::Environment* environment;
 oracle::occi::Connection *con;
 oracle::occi::Statement* stmt;
 oracle::occi::ResultSet* res;

 try{

     environment = oracle::occi::Environment::createEnvironment(oracle::occi::Environment::DEFAULT);
     con = environment->createConnection("rahul", "rahul", "ora11gr2");

     stmt = con->createStatement("select * from example");
     res = stmt->executeQuery();

     while (res->next())
         std::cout<<res->getInt(1)<<"  "<<res->getString(2)<<std::endl;

     stmt->closeResultSet(res);
     con->terminateStatement(stmt);
     environment->terminateConnection(con);

 }catch(oracle::occi::SQLException &e){
     std::cout<<e.what();
 }
 return 0;
 }

并且编译器给出错误:/ opt / projects / codeblock projects / c ++ oracle / main.cpp | 2 |致命错误:occi.h:没有这样的文件或目录|

我的环境是: -

   export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib:/opt/oracle/instantclient_11_2:/opt/Qt5.3.2/5.3/Src/qtbase/lib:

 $LD_LIBRARY_PATHexport 

PATH=/usr/lib/oracle/11.2/client/bin:/opt/oracle/instantclient_11_2: /opt/Qt5.3.2/5.3/gcc/bin:/sbin:$PATH
 export TNS_ADMIN=/opt/oracle/instantclient_11_2


export INCLUDEPATH=/opt/Qt5.3.2/5.3/gcc/include/QtPlatformSupport/5.3.2/QtPlatformSupport/private:/#usr/include/oracle/11.2/client:/opt/Qt5.3.2/5.3/gcc/include:$INCLUDEPATH

  export OCI_LIB_DIR=/usr/lib/oracle/11.2/client/libexport
  OCI_INCLUDE_DIR=/usr/include/oracle/11.2/clientexport 
  OCI_VERSION=11
  export OCI_INCLUDE_DIR=/usr/include/oracle/11.2/client 
  ORACLE_HOME=/usr/lib/oracle/11.2/client

有一个问题就是在命令提示符下运行时出现shell错误 &#34; #source / etc / bashrc&#34; (输入) 错误是: - &#34;:找不到命令&#34;

0 个答案:

没有答案