How to link a specific version of a shared library in makefile without using LD_LIBRARY_PATH?

﹥>﹥吖頭↗ 提交于 2019-11-29 04:11:52
Z.Zen

I figured out that I can include the absolute path of the specific library that I want to link to and it worked fine for me:

LD = ${RPATH} -lsocket -lnsl -lpthread ${OPENSSLDIR}/lib/libssl.so.1.0.0 \
         ${OPENSSLDIR}/lib/libcrypto.so.1.0.0

If you are using g++, Piotr Lesnicki pointed out that -l:libssl.so.1.0.0 also works. See more at the original post.

Raghuram

Do you have any links to the SSL lib? If not, can you create a link to the the desired SSL lib like

ln -s libssl.so.1.0.0 libssl.so 

in the ssl directory and try it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!