Почему мой клиент Oracle soci не может подключиться к моему серверу Oracle? - PullRequest
0 голосов
/ 20 ноября 2018

Это мой main.cpp:

#include <soci/soci.h>
#include<soci/oracle/soci-oracle.h>
#include<iostream>
#include<istream>
#include<ostream>
#include<string>
#include<exception>
#include<unistd.h>

using namespace std;
using namespace soci;


int main() {
    session sql(oracle,"service=ORCL host=10.108.208.175 port=1521 user=IOVUSER password=iov123");
    cout << "has connected!!"<<endl;
    string sql_str = "select * from cf1";

    sql << sql_str;

}

И это мой make-файл:

all: main.cpp
    g++ -std=c++11 -Wall -g -o main main.cpp -I/opt/oracle/product/11.2.0/dbhome_1/rdbms/public/  -L/usr/local/lib64/ -lsoci_core -lsoci_oracle -ldl
clean:

Когда я запускаю основной, он показывает, что не может подключиться к серверу, моя конфигурацияright.Why?Это результат:

./main 
terminate called after throwing an instance of 'soci::oracle_soci_error'
  what():  ORA-12154: TNS:could not resolve the connect identifier specified

[1]    16160 abort (core dumped)  ./main
...