方法一

export LD_LIBRARY_PATH 不生效,修改vi /etc/ld.so.conf, 把待链接的库加到里面去,然后
ldconfig 让它生效。

方法二

在启动程序前, 加 LD_LIBRARY_PATH=/home/yourlib ./test (未验证)