-1
我試圖用g ++以及每一次我正在此錯誤的編譯時間我cpp的代碼:克++:錯誤嘗試執行「JC1」:execvp:沒有這樣的文件或目錄
g++: error trying to exec 'jc1': execvp: No such file or directory.
我執行此命令:
g++ -L/root/Shared/instantclient_11_2_lib/* -L $ORACLE_HOME/rdbms/lib/* -L $ORACLE_HOME/lib/* cpp_db_conn.cpp
我的cpp程序包含與oracle db連接的代碼。 我cpp的代碼如下:
#include <iostream>
#include "/root/instantclient_11_2/sdk/include/occi.h"
using namespace oracle::occi;
using namespace std;
int main(){
oracle::occi::Environment* environment;
oracle::occi::Connection* con;
oracle::occi::Statement* stmt;
oracle::occi::ResultSet* res;
try {
environment = Environment::createEnvironment(Environment::DEFAULT);
con = environment->createConnection("tkmah7u", "root", "XE");
stmt = con->createStatement("select * from customers");
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;
}
仍然有相同的錯誤。 –