码迷,mamicode.com
首页 > Web开发 > 详细

net-snmp 5.7.3 子代理程序 libnetsnmp.so.30 not found解决办法

时间:2015-03-18 12:25:50      阅读:889      评论:0      收藏:0      [点我收藏+]

标签:ubuntu   c   共享库   snmp   library   

用net-snmp-5.7.3开发的子代理程序执行后,报错“./mysnmp: error while loading shared libraries: libnetsnmpmibs.so.30: cannot open shared object file: No such file or directory”

原因是 LD_LIBRARY_PATH环境变量没有定义,执行下面的语句:

<strong><span style="font-size:24px;color:#ff0000;">export LD_LIBRARY_PATH=/usr/local/lib</span></strong>

解决过程示例:

root@map:/usr/local/lib# ldd /home/kpiss/net-snmp-5.7.3/agent/mibgroup/chanctsnmp 
        linux-vdso.so.1 =>  (0x00007fff577e2000)
        libnetsnmpmibs.so.30 => not found
        libnetsnmpagent.so.30 => not found
        libnetsnmp.so.30 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc5207a7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc520b70000)
root@map:/usr/local/lib#  export LD_LIBRARY_PATH=/usr/local/lib                 
root@map:/usr/local/lib# ldd /home/kpiss/net-snmp-5.7.3/agent/mibgroup/chanctsnmp 
        linux-vdso.so.1 =>  (0x00007fffef1fe000)
        libnetsnmpmibs.so.30 => /usr/local/lib/libnetsnmpmibs.so.30 (0x00007fc14b29c000)
        libnetsnmpagent.so.30 => /usr/local/lib/libnetsnmpagent.so.30 (0x00007fc14b03a000)
        libnetsnmp.so.30 => /usr/local/lib/libnetsnmp.so.30 (0x00007fc14ad50000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc14a98a000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc14a786000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc14a568000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc14a360000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc14b70a000)

参考:

https://www.mail-archive.com/net-snmp-users%40lists.sourceforge.net/msg16168.html

net-snmp 5.7.3 子代理程序 libnetsnmp.so.30 not found解决办法

标签:ubuntu   c   共享库   snmp   library   

原文地址:http://blog.csdn.net/svap1/article/details/44407855

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!