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

已标记关键词 清除标记
表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页