ldd命令用于判断某个可执行的 binary 档案含有什么动态函式库
[diego@localhost ~/work/branch_dispatch_201511/rtqa_center/source]# ldd ctrl_svr
linux-vdso.so.1 => (0x00007fff3f957000)
libprotobuf.so.9 => /usr/local/lib/libprotobuf.so.9 (0x00007fa4f0160000)
libevent-2.0.so.5 => ../third_party/lib/libevent-2.0.so.5 (0x00007fa4eff1a000)
libevent_pthreads-2.0.so.5 => ../third_party/lib/libevent_pthreads-2.0.so.5 (0x00007fa4efd18000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003d56600000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003d7ee00000)
librt.so.1 => /lib64/librt.so.1 (0x0000003d56a00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003d55e00000)
libjsoncpp.so.0 => ../third_party/lib/libjsoncpp.so.0 (0x00007fa4efaa1000)
libsched.so => ../third_party/lib/libsched.so (0x00007fa4ef88a000)
libboost_chrono.so.1.59.0 => /usr/local/lib/libboost_chrono.so.1.59.0 (0x00007fa4ef683000)
libboost_system.so.1.59.0 => /usr/local/lib/libboost_system.so.1.59.0 (0x00007fa4ef47f000)
librabbitmq.so.4 => not found
libSimpleAmqpClient.so => ../third_party/lib/libSimpleAmqpClient.so (0x00007fa4ef11e000)
libm.so.6 => /lib64/libm.so.6 (0x0000003d56e00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003d7ea00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d56200000)
libz.so.1 => /lib64/libz.so.1 (0x0000003d57200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d55a00000)
当找不到相应的so时,会报错:
./ctrl_svr: error while loading shared libraries: librabbitmq.so.4: cannot open shared object file: No such file or directory