在Windows上使用某些OpenSSL功能而不安装它

时间:2014-04-11 08:43:55

标签: windows visual-studio visual-c++ mfc openssl

我正在尝试将一个Linux程序移植到Windows。这个Linux程序使用OpenSSL中的一些函数:

#include <openssl/bn.h>
#include <openssl/dh.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>
#include <openssl/rc4.h>

如您所见,它仅使用少数常见的加密函数:Diffie-Hellman,SHA,HAMC,RC4

Windows上的最终用户必须安装OpenSSL才能运行程序,这不是用户友好的。

我可以在不要求用户安装OpenSSL的情况下使用这些加密功能吗? (比如静态链接dll?)

1 个答案:

答案 0 :(得分:0)

将库(libs),DLL文件和头文件复制到应用程序构建目录结构中,通过链接器选项引用并链接它。 是的,您必须使用您的应用程序从OpenSSL发送DLL文件。