我在Oracle Linux 7.1虚拟机上安装了Oracle Instant Client 12.1(基本版和SDK版)和Ocilib 4.0.1。
$ORACLE_HOME
是/usr/lib/oracle/12.1/client64
$LD_LIBRARY_PATH
是/usr/lib/oracle/12.1/client64/lib:/usr/local/lib
要安装ocilib,我指定了oracle home,oracle lib path和oracle headers path(./configure --with-oracle-home=/usr/lib/oracle/12.1/client64 --with-oracle-lib-path=/usr/lib/oracle/12.1/client64/lib --with-oracle-headers-path=/usr/include/oracle/12.1/client64
)
在eclipse的项目属性中,在GCC C Linker的库搜索(-L)路径中我有/usr/lib/oracle/12.1/client64/lib and /usr/local/lib
,在库(-l)中我有ocilib, clntsh, clntshcore, nnz12, mql1, ipc1, ons
(所有这些都是成功编译的必要条件)。
当我尝试调试它时显示:error while loading shared libraries: libocilib.so.4: cannot open shared object file: No such file or directory
但我在libocilib.so.4
上有/usr/local/lib
(它是libocilib.so.4.0.1的链接,我也有链接libocilib.so指向libocilib.so.4.0.1 ),所以我不知道为什么它无法加载该库。