如何在没有编译openssl.dll
和libeay.dll
的情况下使用openssl源构建应用?
我下载了openssl-0.9.8h
,将path-to-sources/include/.
文件的包含路径设置为include/openssl/
文件../../{crypto/_algo-name_/algosource.h}
的链接,而VS不理解这些链接。
答案 0 :(得分:0)
实际上,您需要构建OpenSSL并在makefile中指定的补丁中生成库和头文件。你应该使用那些包含文件。这些头文件就像模板文件,在构建OpenSSL时使用。请参阅this问题。
并搜索如何在Windows上构建OpenSSL。
正如您在编译后提到的问题,不需要OpenSSL,您可以通过以下方式完成:
生成OpenSSL的静态库并在您的应用程序中使用它。现在,在编译完应用程序后,将不再需要OpenSSL dll。
如果您的应用程序非常小,可以使用OpenSSL静态库进行编译。
答案 1 :(得分:0)
如何使用openssl源构建应用程序,而无需编译openssl.dll和libeay.dll
你做不到。您需要首先构建OpenSSL库。
我下载了openssl-0.9.8h,设置了包含路径到路径的路径/ include /....
下一步是打开INSTALL.W32
并阅读说明。这是大多数步骤的例外情况。但请务必使用Visual Studio命令提示符执行它,以便cl.exe
和link.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:\some\openssl\dir
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:
> ms\do_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
> ms\do_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 ms\ntdll.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 ms\ntdll.mak test
To install OpenSSL to the specified location do:
> nmake -f ms\ntdll.mak install
Shining Light Productions的Thomas Hruska提供Win32 OpenSSL。它是一个带有Windows安装程序的预构建OpenSSL。他多年来一直在提供它。
安装完成后,只需在Visual Studio中指向它即可。 Cygwin,Perl和脚本等环境无需修改源代码,因此Unix和Linux可以在Windows上运行。 (这对我来说是一个愚蠢的想法.Windows是Windows,Linux是Linux。停止尝试让其中一个像另一个一样)。