免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2622 | 回复: 1

!!!求助!!!ldconfig能否改变ld查找so文件的路径? [复制链接]

论坛徽章:
0
发表于 2010-05-19 15:54 |显示全部楼层
本帖最后由 johnsonyoung 于 2010-05-20 15:51 编辑

重新编译Qt时把原来的路径由qt1变成了qt2,然后修改/etc/profile中的QTDIR=/qt2,PATH=$QTDIR/bin: $PATH, LD_LIBRARY_PATH=$QTDIR/lib: $LD_LIBRARY_PATH,
修改/etc/ld.so.conf,只包括路径/qt2,然后ldconfig -v,可以看到输出结果中包含了/qt2/lib下的各个库文件,再用ldconfig -p来看下/etc/ld.so.cache内容也确实包括的是/qt2/lib的库文件
重启后查看env,所有变量都只有/qt2而没有qt1,这时重新编译程序后得到的可执行文件app
而使用ldd -r app却发现其链接库仍然是qt1/lib,请问问题到底出现在哪里?为什么无法更改到新的qt2库目录,qt1目录早已经删除,查找了所有的文件也看不到包含qt1,到底ldconfig对ldd没有任何影响吗?那应该如何更新库文件路径呢?
谢谢各位热心帮助!

论坛徽章:
0
发表于 2010-07-07 18:07 |显示全部楼层
路径是在/etc/ld.so.conf中修改的, man ldconfig
       ldconfig  creates the necessary links and cache to the most recent shared libraries found in the directo-
       ries specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and
       /usr/lib).   The  cache is used by the run-time linker, ld.so or ld-linux.so.  ldconfig checks the header
       and filenames of the libraries it encounters when determining which  versions  should  have  their  links
       updated.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP