OpenSSL: can't build in VC++ 2010

。_饼干妹妹 提交于 2019-11-30 06:55:43

The problem seems to be related to eol (end of lines). The solution is to patch mk1mf.pl to make it remove the carriage-return:

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:

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.

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

Other perl builds such as the MSYS build will give you this error.

In order to figure out if you're using ActivePerl, run perl.exe --version in a command prompt. 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. You should use sources extracted from .tar.gz by MSYS tools:

  $ tar zxvf openssl-1.0.2d.tar.gz

or checkout from git with configuration "autocrlf false" set before checkout:

  > 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:

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!