Linux 編譯安裝OciLib 4 x x

2022-02-13 20:11:48 字數 2616 閱讀 1047

專案要用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 的標頭檔案的資料夾沒找到;

-------------------更新---------------- 2020/07/01

# 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

fifi

fifi

因為我是直接把sdk的include資料夾解壓到 /usr/local/instantclient_12_1 的,所以 直接寫了:

ac_headers_path=$ac_oracle_home/include
-------------------更新---------------- 2020/07/01

可以不用改`makefile`,直接引數指定

./configure  cflags="

-o2 -m64

" --with-oracle-lib-path=/usr/local/instantclient_12_1 --with-oracle-headers-path=/usr/local/instantclient_12_1/include

cflags 引數很重要, -m64 表示編譯為64位。

--with-oracle-lib-path 引數指定 lib 目錄

--with-oracle-headers-path 引數指定 頭檔案目錄

這樣就應該不需要設定環境變數了, 不行在按下方設定咯~~

然後要配置環境變數的!!!

根據這裡(配置了,沒重新登入 沒起作用, 於是直接執行了下:

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 :

github : 

ps:不過這個庫貌似預設是編譯的 32位的, 如如何編譯64位的, 看上面更新說明的cflags引數。, 謝謝!

編譯安裝 Linux編譯安裝Perl Tk模組

perl語言擁有很強的正則,相較cshell在genesis,incam指令碼中有更多的靈活性,使用tk可以編寫出媲美windows的圖形介面。預設沒有安裝相關圖形模組如tk等,需要編譯安裝,本文以centos 6.10環境為例說明。安裝系統編譯工具,在系統聯網的情況下,切換root使用者,輸入 執...

linux編譯安裝codeblocks

linux安裝codeblocks挺麻煩的,現在記錄一下流程 1.安裝repoforge rpmforge release 0.5.2 2.el6.rf.rpm 即可安裝 2.安裝wxgtk 解壓縮後,進入目錄,執行命令 configure enable unicode make make inst...

Linux 編譯安裝Boost

linux 編譯安裝boost 如果是windows平台,請參考 鏈結 linux平台下要編譯安裝除gcc和gcc c 之外,還需要兩個開發庫 bzip2 devel 和python devel,因此在安裝前應該先保證這兩個庫已經安裝 yum install gcc gcc c bzip2 bzip...