CentOS 安装OciLib 4.2.1 (Linux)

项目要用oracle , Windows的 OciLib 好弄, 今天安装到linux下 ,编译老是出错,最后几行如下:

checking for OCILIB install path... /usr/local
ls: cannot access *.html: No such file or directory
ls: cannot access *.css: No such file or directory
ls: cannot access *.png: No such file or directory
checking for OCILIB version... v4.2.1 
checking for OCILIB options... import: linkage, charset = ansi 
checking for Oracle home... defined by environment : 
checking for Oracle OCI headers location... configure: error: variable not set or unable to guess

然后搜索 Configure文件,最终发现是 oracle oci 的头文件的文件夹没找到;

然后到oracle官网下载 instantclient-sdk-linux 又是一阵折腾,不知道他抽什么疯,死活不能下载, 下载页点击跳转就到错误页了~~~

后来网上找了个下载,还好,能用(文件大小只有625KB), 地址:http://download.csdn.net/detail/lsxy117/5118691

但是下载解压后 Configure里的路径居然没有include文件夹的配置,尼玛,自己写了(约第12775行处):

      # find out the Oracle public OCI headers path
      if test "$ac_headers_path" = NO; then
        if test "$ac_oracle_home" != NO; then
          test_include_path=$ac_oracle_home/rdbms/public
          if test -d "$test_include_path"; then
            ac_headers_path=$test_include_path
          else
            test_include_path=$ac_oracle_home/rdbms/demo
            if test -d "$test_include_path"; then
              ac_headers_path=$test_include_path
            else
              echo "line 12775 ,lzpong add this ac_headers_path to $ac_oracle_home/include , need to download instantclient-sdk-linux-xx.xx.xx.zip to get includes file!!!!"
              ac_headers_path=$ac_oracle_home/include
            fi
          fi
        fi
      fi

因为我是直接把sdk的include文件夹解压到 /usr/local/instantclient_12_1 的,所以 直接写了:

ac_headers_path=$ac_oracle_home/include

然后要配置 环境变量的!!!

根据这里(http://ljhzzyx.blog.163.com/blog/static/3838031220107139322436/)配置了,没重新登录 没起作用, 于是直接执行了下:

export ORACLE_HOME=/usr/local/instantclient_12_1

export PATH=$ORACLE_HOME:$PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME

export TNS_ADMIN=$ORACLE_HOME/network/admin

export NLS_LANG="Simplified Chinese_china".ZHS16GBK

./configure

make

make install

 

至此, 已经安装好了 ^_^, 没有出错哦,

lib文件在 /usr/local/lib

头文件在 /usr/local/include

好了,可以使用 OciLib 4.2.1 了 ;

 

也可以查看他的 readme 文件, 可以搭配一些参数make install

Website : http://www.ocilib.net

GitHub : https://github.com/vrogier/ocilib

 

PS:不过这个库貌似是编译的 32位的, 如如何编译64位的, 请知道的同学告知我, 谢谢!

 

转载于:https://www.cnblogs.com/lzpong/p/5764467.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值