Visual Studio-如何使用OpenSSL源构建应用程序



如何使用openssl源构建应用程序,而无需编译openssl.dlllibeay.dll?我下载了openssl-0.9.8h,设置包括include/openssl/path-to-sources/include/.文件的路径,它的链接到文件../../{crypto/_algo-name_/algosource.h},而VS不了解此链接。

实际上,您需要构建openssl,这将在makefile中指定的补丁中生成库和标头文件。您应该使用其中包括文件。这些标头文件就像模板文件一样,在构建OpenSSL时使用。看到这个问题。

并搜索如何在Windows上构建OpenSSL。

汇编后您提到的问题,不需要openssl,您可以按照以下方式进行操作:

  1. 生成OpenSSL的静态库,并在您的应用程序中使用它。现在,在您的申请编译后,将不需要OpenSSL DLL。

  2. 如果您的应用程序很小,则可以使用OpenSSL静态库进行编译。

如何使用openssl的源构建应用

你不能。您需要先构建OpenSSL库。


我下载了openssl-0.9.8h,设置包括通往途径的途径/include/....

您的下一步是打开INSTALL.W32并阅读说明。这是大多数步骤的Exceprt。但是请确保使用Visual Studio命令提示进行执行,以便cl.exelink.exe之类的工具在路径上。

 If you want to compile in the assembly language routines with Visual
 C++, then you will need already mentioned Netwide Assembler binary,
 nasmw.exe or nasm.exe, to be available on your %PATH%.
 Firstly you should run Configure with platform VC-WIN32:
   > perl Configure VC-WIN32 --prefix=c:someopenssldir
 Where the prefix argument specifies where OpenSSL will be installed to.
 Next you need to build the Makefiles and optionally the assembly
 language files:
 - If you are using NASM then run:
     > msdo_nasm
 - If you don't want to use the assembly language files at all then run:
     > perl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir
     > msdo_ms
 If you get errors about things not having numbers assigned then check the
 troubleshooting section: you probably won't be able to compile it as it
 stands.
 Then from the VC++ environment at a prompt do:
   > nmake -f msntdll.mak
 If all is well it should compile and you will have some DLLs and
 executables in out32dll. If you want to try the tests then do:
   > nmake -f msntdll.mak test    
 To install OpenSSL to the specified location do:
   > nmake -f msntdll.mak install

Shining Light Productions的Thomas Hruska

提供Win32 OpenSSL。它是带有Windows安装程序的预先构建的OpenSSL。他已经提供了多年。

安装后,只需在Visual Studio中指向它。诸如Cygwin,Perl和脚本之类的环境不会大惊小怪,可以修改源代码,以便Unix和Linux在Windows上工作。(对我来说,这是一个愚蠢的想法。Windows是Windows,Linux是Linux。停止尝试使一个表现像另一个"。

最新更新