【问题标题】:Compile OpenSSL in Visual Studio在 Visual Studio 中编译 OpenSSL
【发布时间】:2016-09-06 12:20:02
【问题描述】:

我有

  • ActivePerl 5.24 x86
  • NASM 2.12.02
  • Visual Studio 2010 Ultimate 10.0.30309
  • Windows 7 Ultimate x64

我提取源代码,打开Visual Studio Command Prompt (2010)并输入以下命令:

perl Configure VC-WIN32 --prefix:C:\openSSL-win32

我得到这个错误:

您的电脑上似乎没有 nmake.exe 或 dmake.exe PATH,因此您将无法从 Makefile 执行命令。 您可以通过运行以下命令使用 Perl 包管理器安装 dmake.exe: ppm 安装 dmake

我肯定在 VS 命令提示符中有 nmake。如何告诉 Perl 在 VS 目录中查看我的 nmake?

P.S.这些路径在我的 %PATH% 中:

  • C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
  • C:\Perl\bin
  • C:\Program Files (x86)\NASM

编辑:下面是我当前的路径。

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\
C:\Perl\site\bin
C:\Perl\bin
C:\app\User\product\11.2.0\client_1\bin
C:\ProgramData\Oracle\Java\javapath
C:\Program Files (x86)\Intel\iCLS Client\
C:\Program Files\Intel\iCLS Client\
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files\Intel\WiFi\bin\
C:\Program Files\Common Files\Intel\WirelessCommon\
C:\Program Files\ThinkPad\Bluetooth Software\
C:\Program Files\ThinkPad\Bluetooth Software\syswow64
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64
C:\SWTOOLS\ReadyApps
C:\Program Files (x86)\Common Files\Lenovo
c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
c:\Program Files\Microsoft SQL Server\100\Tools\Binn\
c:\Program Files\Microsoft SQL Server\100\DTS\Binn\
C:\Program Files\Microsoft\Web Platform Installer\
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\
C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\
C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\
C:\Program Files (x86)\NASM\

【问题讨论】:

  • 打开开发者提示符并将目录更改为 OpenSSL,详见 nmake: command not found when building OpenSSL。为了完整起见,OpenSSL 不提供 Visual Studio 项目文件,因此您不能在 Visual Studio 本身下构建。但是,您碰巧使用了 Visual Studio 工具。如果您确实在 Web 上找到了一些 Visual Studio 项目文件,它们可能(或可能不)工作,但它们肯定不会是 OpenSSL 项目的官方文件。
  • 我已经按照你说的做了。我打开Visual Studio Command Prompt 并尝试配置openssl 项目。不需要 VS 项目文件。人们在没有 VS 项目文件的情况下这样做。
  • 听起来您的路径不太正确。我使用该配置测试 OpenSSL(因此在 RT 中有一些 Windows 错误报告),所以我知道它可以工作。回显你%PATH% 或运行set 打印它,然后发布路径。另外,什么版本的 OpenSSL? OpenSSL 1.1.0 和 Windows 在发布之前得到了相当多的关注。但它可能在发布之前就已经弯曲了。
  • 这是我的 %PATH%:pastebin.com/L5iKuFn5 你可以看到我里面有 perl、VS 和 nasm。是的,openSSL 是 1.1.0
  • 看起来不像是开发者提示;它看起来像一个常规的命令提示符。你手动添加C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin 吗?它还缺少 ...\VC\bin\amd64 作为第二个路径条目。当我查看我的Win8.1测试机时,我有:(1)VS 2012:C:\Program Files (x86)\Microsoft Visual Studio 11; (2)VS 2013:C:\Program Files (x86)\Microsoft Visual Studio 12; (3) VS 2015:C:\Program Files (x86)\Microsoft Visual Studio 14;

标签: visual-studio compilation openssl activeperl


【解决方案1】:

这是我解决它的方法(实际上是openssl的开发者在githubhelped me)。我安装了Strawberry Perl,安装了Visual Studio 2010 SP1(免费下载,大约1.5 GB,你也可以在Install Instructions部分下载ISO格式,这是必要的),安装了Windows 7 SDK 7.1(也许是'没有必要,如果没有任何工作安装它),安装NASM。打开 Visual Studio 2010 命令提示符(快捷方式在开始菜单中)。转到 VS 命令提示符中存在 openSSL 源代码的文件夹。然后输入这些命令:

perl Configure VC-WIN32    
nmake    
nmake test    
nmake install

nmake test 之后,您应该会看到STATUS: PASSED。在nmake install 之后检查您的Program Files (x86) 文件夹。应该有两个DLL和openssl.exe

附:将 NASM 和 Perl 放在你的 %PATH% 中。

祝你好运

【讨论】:

  • PlusOnenmake test。很多人跳过了这一步。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-12-30
  • 2019-07-24
  • 1970-01-01
  • 2015-09-26
  • 1970-01-01
  • 2011-05-31
  • 1970-01-01
相关资源
最近更新 更多