欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

标题:解决安装oracle /usr/bin/ld: cannot find -lclntshcore的问题

最编程 2024-02-25 16:16:23
...

问题:

"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs 644
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
LD_RUN_PATH="/opt/user/lib/instantclient_19_15" x86_64-linux-gnu-gcc  -shared -L/usr/local/lib -fstack-protector-strong  Oracle.o dbdimp.o oci8.o  -o blib/arch/auto/DBD/Oracle/Oracle.so  \
   -L/opt/user/lib/instantclient_19_15/ -Wl,-rpath,/opt/user/lib/instantclient_19_15/ -lclntsh -Wl,--no-as-needed -lclntshcore -lipc1 -lmql1   \
  
/usr/bin/ld: cannot find -lclntshcore
collect2: error: ld returned 1 exit status
make: *** [Makefile:524: blib/arch/auto/DBD/Oracle/Oracle.so] Error 1

root# ln -s /oracle/base/dbhome_1/lib/libclntshcore.so.12.1 /usr/lib/
root# ls -l /usr/lib/libclntshcore.so.12.1
lrwxrwxrwx 1 root root 47 Sep 19 11:08 /usr/lib/libclntshcore.so.12.1 -> /oracle/base/dbhome_1/lib/libclntshcore.so.12.1
root#

Weird, this lib is an oracle lib..and the installer is looking for it in the wrong location. I’ll link this lib in the general lib location where it always can be found: /usr/lib.

这个库是oracle的一个库 并不是放在/usr/lib下 所以gcc找不到路径
我明白了,是gcc找不到,于是我在/usr/lib下做了软连接
ln -s $ORACLE_HOME libclntshcore.so.19.1 libclntshcore.so
说白了就是保证/usr/lib下目录面有 libclntshcore.so文件
在这里插入图片描述

在这里插入图片描述