简体   繁体   English

OpenSSL:无法在VC ++ 2010中构建

[英]OpenSSL: can't build in VC++ 2010

I have downloaded the latest OpenSSL source package. 我已经下载了最新的OpenSSL源代码包。 I want to build it with VC++ 2010 x64. 我想用VC ++ 2010 x64构建它。 Following the instructions doesn't seem to work. 按照说明似乎不起作用。 Configure step looks fine, but then: 配置步骤看起来很好,但随后:

C:\\1>ms\\do_win64a.bat C:\\ 1> MS \\ do_win64a.bat

C:\\1>perl util\\mkfiles.pl 1>MINFO C:\\ 1> perl util \\ mkfiles.pl 1> MINFO

C:\\1>perl ms\\uplink.pl win64a 1>ms\\uptable.asm C:\\ 1> perl ms \\ uplink.pl win64a 1> ms \\ uptable.asm

C:\\1>ml64 -c -Foms\\uptable.obj ms\\uptable.asm Microsoft (R) Macro Assembler (x64) Version 10.00.30319.01 Copyright (C) Microsoft Corporation. C:\\ 1> ml64 -c -Foms \\ uptable.obj ms \\ uptable.asm Microsoft(R)宏汇编程序(x64)版本10.00.30319.01版权所有(C)Microsoft Corporation。 All rights reserved. 版权所有。

Assembling: ms\\uptable.asm 组装:ms \\ uptable.asm

C:\\1>perl util\\mk1mf.pl no-asm VC-WIN64A 1>ms\\nt.mak no rule for crypto\\md4 at util\\mk1mf.pl line 907. C:\\ 1> perl util \\ mk1mf.pl no-asm VC-WIN64A 1> ms \\ nt.mak在util \\ mk1mf.pl第907行没有关于crypto \\ md4的规则。

C:\\1>perl util\\mk1mf.pl dll no-asm VC-WIN64A 1>ms\\ntdll.mak no rule for crypto\\md4 at util\\mk1mf.pl line 907. C:\\ 1> perl util \\ mk1mf.pl dll no-asm VC-WIN64A 1> ms \\ ntdll.mak在util \\ mk1mf.pl第907行没有关于crypto \\ md4的规则。

C:\\1>perl util\\mkdef.pl 32 libeay 1>ms\\libeay32.def C:\\ 1> perl util \\ mkdef.pl 32 libeay 1> ms \\ libeay32.def

C:\\1>perl util\\mkdef.pl 32 ssleay 1>ms\\ssleay32.def C:\\ 1> perl util \\ mkdef.pl 32 ssleay 1> ms \\ ssleay32.def

Win 32 (do_ms) output looks a bit different, but "no rule for crypto\\md4 at util\\mk1mf.pl line 907" remains. Win 32(do_ms)输出看起来有点不同,但“在util \\ mk1mf.pl第907行没有加密\\ md4的规则”仍然存在。

Could anyone help me in building the library or share vc2010-built binaries?.. Or a VS2010 project file for the library? 任何人都可以帮助我构建库或共享vc2010构建的二进制文件吗?或者是库的VS2010项目文件?

The problem seems to be related to eol (end of lines). 问题似乎与eol(行尾)有关。 The solution is to patch mk1mf.pl to make it remove the carriage-return: 解决方案是修补mk1mf.pl以使其删除回车:

Index: mk1mf.pl
===================================================================
--- mk1mf.pl    (revision 88908)
+++ mk1mf.pl    (working copy)
@@ -315,7 +315,7 @@
 for (;;)
        {
        chop;

+       s/\r$//; #remove carriage return too!
        ($key,$val)=/^([^=]+)=(.*)/;
        if ($key eq "RELATIVE_DIRECTORY")
                {

Found the solution in openssl users mailing: 在openssl用户邮件中找到解决方案:

http://groups.google.com/group/mailing.openssl.users/browse_thread/thread/42a8f226f1fc279f ) http://groups.google.com/group/mailing.openssl.users/browse_thread/thread/42a8f226f1fc279f

The patch provided above works, but a better solution is to use use ActivePerl, as recommended in the OpenSSL documentation. 上面提供的补丁有效,但更好的解决方案是使用ActivePerl,如OpenSSL文档中所建议的那样。

http://www.activestate.com/activeperl/downloads http://www.activestate.com/activeperl/downloads

Other perl builds such as the MSYS build will give you this error. 其他perl构建,如MSYS构建将给你这个错误。

In order to figure out if you're using ActivePerl, run perl.exe --version in a command prompt. 为了确定您是否使用ActivePerl,请在命令提示符下运行perl.exe --version。 It should say something like: 它应该说:

Binary build 1601 [296175] provided by ActiveState http://www.ActiveState.com

Looks like you're using MSYS perl, which follows unix-style line endings. 看起来你正在使用MSYS perl,它遵循unix风格的行结尾。 You should use sources extracted from .tar.gz by MSYS tools: 您应该使用MSYS工具从.tar.gz中提取的源:

  $ tar zxvf openssl-1.0.2d.tar.gz

or checkout from git with configuration "autocrlf false" set before checkout: 或者在结帐前使用配置“autocrlf false”从git结帐:

  > git config --global core.autocrlf false
  > git clone https://github.com/openssl/openssl

This article has vetted some of the weirdness of building OpenSSL with Visual Studio: 本文审查了使用Visual Studio构建OpenSSL的一些奇怪之处:

http://developer.covenanteyes.com/building-openssl-for-visual-studio/ http://developer.covenanteyes.com/building-openssl-for-visual-studio/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM