c - 具体如何使用OpenSSL?

标签 c ubuntu gcc openssl md5

好吧,我需要使用 OpenSSL 库中的 md5() 函数,但是当我编译 gcc 时,出现错误 - “对 md5 的 undefined reference ”。我尝试了一些东西,我在不同的 StackOverFlow 问题中找到了这些东西,但仍然没有效果。

首先我安装了软件包(Ubuntu 13.04):

sudo apt-get install openssl

sudo apt-get install libssl-dev

在我的源代码中,我包含了 openssl/md5 并尝试以这种方式编译所有内容:

gcc main.c -lssl -lcrypto

gcc main.c -L/home/usr/lib -lssl -lcrypto

我错过了什么?请帮忙。

最佳答案

看起来您的 OpenSSL 是使用 no-md5 选项编译的。因此,请下载 OpenSSL 并根据需要使用 md5 构建它。

关于c - 具体如何使用OpenSSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21352935/

相关文章:

c - 尝试在 Cygwin 上编译 checkinstall 时出现 GCC 错误

linux - gcc架构问题

c - 输入回路故障

python - Tensorflow安装成功但不工作

ubuntu - Linux (Ubuntu) : safely remove a USB flash disk via the command line

android - 应用程序不会在手机上启动。使用 Ubuntu 11.10

c - 是否可以在 C 中创建自定义宽度的整数?

c - 如何使用中断?

来自字符串快捷方式的 C 字符

c - 在结构中存储字符串