Oracle 数据库中的 OCCI - 找不到过程 OCIPIsDesc.dll 库中重建的入口点

OCCI in Oracle database - Couldn't find entry point of procedure OCIPIsDescRebuilt in OCI.dll library

本文关键字:dll 重建 入口 OCIPIsDesc 找不到 数据库 OCCI Oracle 过程      更新时间:2023-10-16

我决定使用OCCI (Oracle c++调用接口)将我的c++游戏与Oracle数据库连接起来。我终于成功地编译了包含occi.h的程序,但是现在,当我运行程序时,我得到了消息:

Couldn't find entry point of procedure OCIPIsDescRebuilt in OCI.dll library.

下面是我的一小部分代码,我试图与数据库连接:

#include <occi.h>
#include <iostream>
#include <string>
#include <iomanip>
#include <cstdlib>
using namespace std;
using namespace oracle::occi;
int main()
{
    Environment *env = Environment::createEnvironment(Environment::DEFAULT);
    Connection *conn = env->createConnection("system", "password","localhost:1521");
    cout << "Podaj nick gracza nr 1: ";
    cin >> nick[1];
    cout << "Podaj nick gracza nr 2: ";
    cin >> nick[2];
    Statement *stmt = conn->createStatement();
    stmt->executeUpdate("INSERT INTO uzytkownicy VALUES('1','A',nick[1])");
    stmt->executeUpdate("INSERT INTO uzytkownicy VALUES('1','B',nick[2])");
    ResultSet *rs = stmt->executeQuery("SELECT * FROM basket_tab");
    cout << "The basket has:" << endl;
    while (rs->next())
    {
        string fruit = rs->getString(1);     // get the first column as string
        int quantity = rs->getInt(2);        // get the second column as int
        cout << quantity << " " << fruit << endl;
    }
    env->terminateConnection(conn);
    Environment::terminateEnvironment(env);
}

我使用MS Visual Studio 2010和Oracle Database Express Edition 11g Release 2(11.2)。除了Oracle®c++调用接口程序员指南,11g Release 2(11.2),我还使用了以下网站的资料:

  • Mark Williams博客
  • 这个线程博客

我该如何解决这个问题?也许有一个更简单的方法(作为配置)与数据库连接使用c++程序比通过OCCI ?

我能够通过将oci.dll文件从Oracle 12c即时客户端复制到我的应用程序的bin/Debug或bin/Release目录来摆脱此错误,因此它将被加载,而不是在默认的Oracle 11客户端中安装的oci.dll。