码迷,mamicode.com
首页 > 系统相关 > 详细

CentOS 安装OciLib 4.2.1 (Linux)

时间:2016-08-12 13:34:00      阅读:600      评论:0      收藏:0      [点我收藏+]

标签:

项目要用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位的, 请知道的同学告知我, 谢谢!

 

CentOS 安装OciLib 4.2.1 (Linux)

标签:

原文地址:http://www.cnblogs.com/lzpong/p/5764467.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!