编译错误:/usr/bin/ld:找不到-lclntsh [英] Compilation error: /usr/bin/ld: cannot find -lclntsh
问题描述
在尝试使用make文件编译C程序时,我遇到了下面描述的以下链接错误.
While trying to compile a C program using make file, I am facing the following linking error described below.
我知道这类问题已经在许多其他帖子中进行了讨论,但是我尝试使用其中提出的解决方案,但是它们都没有用.
I know this kind of issues are already discussed in many other posts, but I tried with solutions suggested in them but they all did not work.
/usr/bin/ld:找不到-lclntsh
/usr/bin/ld: cannot find -lclntsh
libclntsh.so和libclntsh.so.10.1位于oracle路径/u01/app/oracle/product/10.2.0/lib中,并且在make文件中作为-L选项提供.我仍然面对这个问题:-
libclntsh.so and libclntsh.so.10.1 are present in oracle path /u01/app/oracle/product/10.2.0/lib and that is being given as -L option in make file. Still I am facing the issue:-
Linking yieldrpt ...
cc -v -g -D_HPUX_SOURCE -DPARETO -Wl,-aarchive -L/u01/app/oracle/product/10.2.0/lib/ yieldrpt.o -lclntsh `cat /u01/app/oracle/product/10.2.0/lib/ldflags` -lmalloc -ldl -lm \
-lmalloc -o yieldrpt
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)
/usr/libexec/gcc/i386-redhat-linux/4.1.2/collect2 --eh-frame-hdr -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -o yieldrpt /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbegin.o -L/u01/app/oracle/product/10.2.0/lib/ -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2/../../.. -aarchive yieldrpt.o -lclntsh -lnbeq10 -lnhost10 -lnus10 -lnldap10 -lldapclnt10 -lnsslb10 -lntcp10 -lntcps10 -lnsslb10 -lntcp10 -lntns10 -lmalloc -ldl -lm -lmalloc -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i386-redhat-linux/4.1.2/crtend.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
make: *** [yieldrpt] Error 1
请让我知道是否需要其他信息. 谢谢
Please let me know if any other info is needed. Thank you
推荐答案
如果已经安装了libclntsh.so.12.1或类似文件,则可以尝试使用以下命令将库符号链接到libclntsh.so:ln -s/usr /lib/oracle/12.1/client64/lib/libclntsh.so.12.1/usr/lib/oracle/12.1/client64/lib/libclntsh.so
If you have libclntsh.so.12.1 or similar is already installed you may try symlinking the library to libclntsh.so with the following command: ln -s /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1 /usr/lib/oracle/12.1/client64/lib/libclntsh.so
这篇关于编译错误:/usr/bin/ld:找不到-lclntsh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!