一例问题:make bbed 时报错”cannot find -lclntsh“

今天在oracle11.2上面编译bbed工具的时候出现报错如下:

 1 [oracle@ora2 lib]$ make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED= 
 2 $ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed
 3 
 4 Linking BBED utility (bbed)
 5 rm -f /u01/oracle/product/11.2.0/bin/bbed
 6 gcc -o /u01/oracle/product/11.2.0/bin/bbed -m32 - 
 7 L/u01/oracle/product/11.2.0/rdbms/lib/ -L/u01/oracle/product/11.2.0/lib/ - 
 8 L/u01/oracle/product/11.2.0/lib/stubs/ -L/u01/oracle/product/11.2.0/lib/ - 
 9 lirc -lipgo /u01/oracle/product/11.2.0/lib/s0main.o 
10 /u01/oracle/product/11.2.0/rdbms/lib/ssbbded.o 
11 /u01/oracle/product/11.2.0/rdbms/lib/sbbdpt.o `cat 
12 /u01/oracle/product/11.2.0/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 - 
13 ln11 -lnl11 -ldbtools11 -lclntsh `cat 
14 /u01/oracle/product/11.2.0/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 - 
15 ln11 -lnl11 -lnro11 `cat /u01/oracle/product/11.2.0/lib/ldflags` - 
16 lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnnz11 -lzt11 -lztkg11 -lclient11 
17 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lmm -lsnls11 -lnls11 -lcore11 - 
18 lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 
19 -lnls11 -lcore11 -lnls11 `cat /u01/oracle/product/11.2.0/lib/ldflags` - 
20 lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat 
21 /u01/oracle/product/11.2.0/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 - 
22 ln11 -lnl11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lsnls11 
23 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 - 
24 lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 -lclient11 -lnnetd11 - 
25 lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 - 
26 lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 
27 -lnls11 `cat /u01/oracle/product/11.2.0/lib/sysliblist` -Wl,- 
28 rpath,/u01/oracle/product/11.2.0/lib -lm `cat 
29 /u01/oracle/product/11.2.0/lib/sysliblist` -ldl -lm - 
30 L/u01/oracle/product/11.2.0/lib
31 /usr/bin/ld: cannot find -lclntsh
32 collect2: ld returned 1 exit status
33 make: *** [/u01/oracle/product/11.2.0/bin/bbed] Error 1

 

google得知make需要此库文件libclntsh.so 而此库文件在ORACLE_HOME/lib目录
查看此目录下有此文件
中间费了一番周折,配置ldconfig文件 等等,到后来才查看一下链接
[oracle@ora2 lib]$ ls -l libclntsh.so
lrwxrwxrwx 1 oracle oinstall 48 Oct 19 08:00 libclntsh.so ->
/u01/oracle/product/10.2.0/lib/libclntsh.so.11.1
发现此文件为链接文件,而原文件路径为10.2.0并非我现在的11.2.0
回想起来刚开始装库的时候设置环境变量 ORACLE_HOME的时候设置错误,而在装完数据
库的时候手动mv了一下,导致符号链接失效
删除链接文件,重新生成。make通过,bbed可使用了。

[oracle@ora2 lib]$ rm -rf libclntsh.so

[oracle@ora2 lib]$ ln -s libclntsh.so.11.1 libclntsh.so

[oracle@ora2 ~]$ make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed

[oracle@ora2 ~]$ bbed
Password:

BBED: Release 2.0.0.0.0 - Limited Production on Mon Oct 21 16:05:50 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

************* !!! For Oracle Internal Use only !!! ***************

BBED>

 

 

posted on 2013-11-04 18:35  woodyx  阅读(750)  评论(0编辑  收藏  举报

导航