【问题标题】:How to run OCI in linux如何在 Linux 中运行 OCI
【发布时间】:2014-07-02 09:21:52
【问题描述】:

需要将我的 C 代码传达给 Oracle 11g。我发现oci是合适的。而且我不知道如何安装它。

开启 Linux kernel-2.6.32-279.el6.i686

我在 hello.c 中使用了这段代码

#include<stdio.h>
#include<oci.h> 
int main(void) 
{
      int x;  
      printf("Please Enter Number: ");  
      scanf("%d",&x);  


return 0; 
}

和命令

gcc hello.c -o hello.o

显示的错误信息:

error: oci.h: No such file or directory

Instant 客户端安装在位置

/u01/app/oracle/product/11.2.0/client_1/instantclient/

我知道这是基本的,但我也是新手。

【问题讨论】:

    标签: c++ c oracle oracle-call-interface occi


    【解决方案1】:

    构建OCI应用需要SDK,包括头文件等。SDK包含在Full客户端和数据库中;由于您使用的是 Instant 客户端,因此您需要额外下载 - 请参阅 the official Oracle Instant Client page 以获取下载链接。

    【讨论】:

      【解决方案2】:

      似乎您没有在您的系统上安装 Oracle g11。这个link 可能会对你有所帮助。

      【讨论】:

      • Oracle 安装在另一台服务器上,需要运行带有头文件 oci.h 或 occi.h 的 c 代码,还要在哪里找到这些头文件。我目前没有
      猜你喜欢
      • 2015-03-15
      • 2012-12-22
      • 2018-10-03
      • 1970-01-01
      • 1970-01-01
      • 2013-08-06
      • 1970-01-01
      • 2022-10-19
      • 1970-01-01
      相关资源
      最近更新 更多