在Windows上使用某些OpenSSL函数而不安装它

在Windows上使用某些OpenSSL函数而不安装它,windows,visual-studio,visual-c++,mfc,openssl,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> #包括 #包括 #包括 #包括 #包括 如您所见,它只使用了几个常见的加密函数:Dif

我正在尝试将一个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?

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

尝试通过
LoadLibrary
GetProcAddress
动态链接到OpenSSL。