为什么我尝试使用 Visual Studio 工具在 Windows 上构建 OpenSSL 失败?

德米特里

我正在尝试构建 openssl 库。我从 GitHub https://github.com/openssl/openssl克隆了一个 repo

现在使用 Visual Studio 2013 的“命令行”。这个命令行:在此处输入图片说明

我使用下一个命令: cd C:\Programs\openssl - 转到带有 openssl repo 的文件夹

perl Configure VC-WIN64A --prefix=C:\Programs\openssl-build - 实际上,我不知道这个命令究竟是做什么的,但所有手册都说它需要。此命令有下一个输出

在此处输入图片说明

并且“是的,我有‘Perl’,当然我安装了‘Perl’”

And the next (and the last) command, which I write ts just simple "nmake". The last becouse the output of this command has some "fatal errors", which doesn't let me continue installation在此处输入图片说明

As you see, the main error is "fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'". As I know, the parametr machine type can be supplied in properties of Solution in Microsoft Visual Studio GUI, but how to set it from command line I have no idea, and openssl doesn't represented by Microsoft Visual Studio Solution, which can be open by MS Visual Studio.

So, maybe somebody knows how to set this property from command line, or, maybe, this error doesn't depends from this and somebody know how to solve this problem.

I hope for your help. Please, guys, second day I try to solve this, you are my last chance!!

Sinan Ünür

Here is what I did. First, I opened a command prompt for 64-bit builds:

$ cl
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629 for x64

Then, I downloaded the current 1.1 release tarball. There is no reason to mess with development versions unless you are actually developing OpenSSL and you are capable of debugging problems in development versions.

$ curl -O https://www.openssl.org/source/openssl-1.1.0e.tar.gz
$ tar xvf openssl-1.1.0e.tar.gz
$ cd openssl-1.1.0e

At this point, I read INSTALL which I recommend you also do instead of saying "I have no idea what this command exectly do". Once you read INSTALL, you will know what the command actually does.

$ perl Configure --prefix=%TEMP%\openssl VC-WIN64A
$ nmake

This gave me no errors, so I went ahead and issued

$ nmake test

which gave me

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

        set SRCTOP=.
        set BLDTOP=.
        set PERL=C:\opt\perl\5.24.1\bin\perl.exe
        set OPENSSL_DEBUG_MEMORY=on
        "C:\opt\perl\5.24.1\bin\perl.exe" ".\test\run_tests.pl"
test\recipes\01-test_abort.t ............ ok
test\recipes\01-test_sanity.t ........... ok
test\recipes\01-test_symbol_presence.t .. ok
...
test\recipes\90-test_sslapi.t ........... ok
test\recipes\90-test_threads.t .......... ok
test\recipes\90-test_v3name.t ........... ok
All tests successful.
文件 = 91,测试 = 433,100 挂钟秒(0.66 usr + 0.27 sys = 0.92 CPU)
结果:通过

在这一点上,我很确定nmake install也可以工作,但我不想替换我系统上的任何内容。

您没有 Perl 或与编程相关的问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用Visual Studio 2017在Windows上构建OpenSSL?

如何从Windows 7计算机在Visual Studio 2015上安装和使用构建工具v120(2013)?

使用 Visual Studio 添加构建工具

Visual Studio、构建工具和 Windows SDK 之间的区别

在Visual Studio 2019中使用v141平台工具集的C ++ / CX项目的构建失败

为什么我不能使用Visual Studio 2015 RC命令行工具来构建Vim?

升级到Visual Studio 2019和v142工具集后,为什么我的程序不再在Windows 7上运行?

Visual Studio Cordova构建失败

使用Visual Studio 2019构建现有的Sln失败

使用Visual Studio 2015 RTM Cordova工具的间歇性Cordova iOS生成失败

Visual Studio 2017“诊断工具意外失败。” 错误

适用于Cordova的Visual Studio工具-失败

尝试使用zlib在Visual Studio上构建ruby

Visual Studio Online构建失败-本地作品

如何通过Visual Studio扩展使构建失败

从Visual Studio 2010的TFS 2013构建失败

在Android Studio上构建失败

使用anaconda在Visual Studio代码上导入matplotlib的pyplot失败

在Windows 10上使用Visual Studio 2015时,是否可以构建和提交与Windows Phone 8.1兼容的UWP应用?

尝试将Visual Studio 2019构建工具安装到Docker映像中

在Windows上构建飞镖:构建失败

我可以在Windows 10上使用Visual Studio 2008吗?

如何在Windows 10上使用Visual Studio 2015 x64配置和构建Tesseract OCR C ++

为什么在Visual Studio Online上Docker的“生成映像”步骤失败?

在Windows Powershell中运行Visual Studio命令行工具

当openssl不在依赖关系图中时,为什么在openssl上交叉编译构建会失败?

新的 Visual Studio for Mac (Xamarin Studio) 与 Windows 上的 Visual Studio 有什么不同吗?

使用“Visual Studio 2019 -> Build”成功构建项目,但使用“MSBuild”失败

为什么我的SSIS工具箱在Visual Studio 2019社区中为空?