Linking libssl and libcrypto in GCC [duplicate]

馋奶兔 提交于 2019-11-27 09:16:43
Andy

It turns out it was something stupid. In the linker step, I was using gcc -Wall -g -lssl -lcrypto -o program program.o. I needed to move the library links to after the object file I was linking, and put libssl before libcrypto:

gcc -Wall -g -o program program.o -lssl -lcrypto

Try including headers using -I option, Look into directory for library using -L and finally specifying the library name with -l

Just making guess here, please specify path based on actual location.

gcc -g -Wall  -L/usr/lib -I/usr/include -lssl -lcrypto -o program program.c 

Hope it may help.

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