在当前环境变量前新增加一个路径
export PATH=/your/bin/path:$PATH
export LD_LIBRARY_PATH=/your/lib/path:$LD_LIBRARY_PATH
export LIBRARY_PATH=/your/lib/path:$LIBRARY_PATH
export CPATH=/your/include/path:$CPATH
将当前环境变量设置为某一个路径
export PATH=/your/bin/path
export LD_LIBRARY_PATH=/your/lib/path
export LIBRARY_PATH=/your/lib/path
export CPATH=/your/include/path
i注意
有时把库cp到路径下还不能立即生效,需要一下缓存:
sudo /sbin/ldconfig –v
或者直接更改/etc/ld.so.conf增加需要增加的路径