关于so硬链接至/usr/lib及/usr/local/lib下的处理方法
2011-11-30 09:54
585 查看
并编写脚本确认,解决硬链接so值系统lib下的方法如下:
编译代码时:
使用-Lpath显示指定要使用的so库,在这里path路径可以是相对路径,也可以是绝对路径
执行代码时:
使用export LD_LIBRARY_PATH= path[绝对路径] --sh的写法
setenv LD_LIBRARY_PATH path --csh的写法
-----------------------------------------------------------------------------------
使用上述方法的不便之处是:在执行程序时必须显式导出相应库的路径。
使用上述方法的好处是:
1) 灵活,可以方便的指定路径和使用不同的库
2) 测试方便,在测试的时候不会在出现类似如下的问题:
2.1) 因为已有其他的版本硬链接,导致无法对最新的版本进行测试
编译代码时:
使用-Lpath显示指定要使用的so库,在这里path路径可以是相对路径,也可以是绝对路径
执行代码时:
使用export LD_LIBRARY_PATH= path[绝对路径] --sh的写法
setenv LD_LIBRARY_PATH path --csh的写法
-----------------------------------------------------------------------------------
使用上述方法的不便之处是:在执行程序时必须显式导出相应库的路径。
使用上述方法的好处是:
1) 灵活,可以方便的指定路径和使用不同的库
2) 测试方便,在测试的时候不会在出现类似如下的问题:
2.1) 因为已有其他的版本硬链接,导致无法对最新的版本进行测试
相关文章推荐
- error: [Errno 13] Permission denied: '/usr/local/lib/处理方法
- 关于静态链接到MFC的项目链接时LIBCMTD.lib中符号重定义问题的处理方法libcmt.lib
- 解决方法/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_'
- /usr/lib/libexpat.so: could not read symbols解决方法
- mysql5.6编译提示Library mysqlserver depends on OSLIBS -lpthread;/usr/local/lib/libz.so;m;rt;
- /sbin/ldconfig.real: /usr/local/lib/libcudnn.so.6.5 is not a symbolic link
- nginx 报异常"/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)处理方法
- 安装Apache时 ./configure出现"/usr/local/src/httpd-2.2.21/srclib/apr":的解决方法
- STORM:/usr/local/lib/libjzmq.so.0.0.0: wrong ELF class: ELFCLASS64
- nginx启动报错:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
- /usr/lib/libcxcore.so.2.1: could not read symbols: Invalid operation 解决方法
- Apache编译安装:/usr/lib/libexpat.so: could not read symbols解决方法
- /usr/local/lib/libopencv_highgui.so:对‘TIFFIsTiled@LIBTIFF_4.0’未定义的引用
- 关于/usr/local/lib/libz.a(zutil.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC解决办法
- /usr/lib/libexpat.so: could not read symbols解决方法
- Linux出现sudo ln -s /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/local/lib/libssl.so.1.0.0
- ubuntu出现ERROR: Could not find 'wxe_driver.so' in: /usr/local/bin/erlang/lib/wx-1.2/priv
- ImportantError:/usr/local/lib/python2.7/dist-packages/gnuradio/uhd/_uhd_swig.so:undefined symbol:_ZN
- 关于lib*.a, lib*.so, lib*.la的使用方法
- nginx 报异常"/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)处理方法