使用 MinGW/MSYS 编译 OpenSSL 时出错

发布于 2024-12-02 09:45:24 字数 395 浏览 1 评论 0 原文

OpenSSL 官方网站下载源文件。我遵循 OpenSSL 文件夹中的 INSTALL.M32 文件。我打开 msys.bat,转到 OpenSSL 文件夹,然后键入

$ ./config

它显示“Configured for MinGW”,然后我键入

$ make

,几分钟后收到错误:

md2test.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

Download source files from official OpenSSL site. I follow the INSTALL.M32 file in OpenSSL folder. I open msys.bat, go to the OpenSSL folder, then type

$ ./config

It says "Configured for MinGW", than I type

$ make

and after few minutes receive error:

md2test.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

对你的占有欲 2024-12-09 09:45:24

我只是打开导致错误的文件 (/test/"md5test.c; rc5test.c; jpaketest.c") 并将该行替换

dummytest.c

#include "dummytest.c"

它与上述解决方案相同,只是速度更快一点......

I simply opened the files that were causing the error (/test/"md5test.c; rc5test.c; jpaketest.c") and replaced the line

dummytest.c

to

#include "dummytest.c"

It's the same solution as stated above, except it's a bit faster...

你列表最软的妹 2024-12-09 09:45:24

问题在于,md2test.c 实际上是一个符号链接,或者是dummytest.c符号链接

如果您使用其他任何东西提取 openssl-1.0.1c.tar.gz

tar xf openssl-1.0.1c.tar.gz

,那么这些符号链接将不会被保留。在 Cygwin 上它之后就可以工作了;不确定 MinGW。

The problem is that md2test.c is actually a symbolic link, or symlink to dummytest.c.

If you extracted openssl-1.0.1c.tar.gz with anything other than

tar xf openssl-1.0.1c.tar.gz

then these symlinks were not preserved. On Cygwin it works after that; not sure about MinGW.

别在捏我脸啦 2024-12-09 09:45:24

就我而言,问题是很少有测试文件(据我记得有 3 个)具有文件名而不是 C++ 代码(类似于 dummitest.c)。我将正确的代码从其他文件夹中的文件复制粘贴到该文件中,但名称相同,一切顺利。

In my case the problem was that few test files (3 as far as I remember) had instead of C++-code the name of file (something like dummitest.c). I copy-paste the right code to that files from files from other folder, but with the same name, and everything went fine.

丢了幸福的猪 2024-12-09 09:45:24

你用什么程序解压'openssl-1.0.0x.tar.gz'? 7-zip 是一个很棒的程序,但似乎有一个错误。

使用 tar 或其他解压缩程序,例如 BreadZip

tar zvxf openssl-1.0.0x.tar.gz

它与上面所述的解决方案相同,只是速度更快一点......:)

What program did you use to decompress 'openssl-1.0.0x.tar.gz'? 7-zip is a great program, but it seems there's a bug.

Use tar or other decompressor such as BreadZip.

tar zvxf openssl-1.0.0x.tar.gz

It's the same solution as stated above, except it's a bit faster... :)

娇柔作态 2024-12-09 09:45:24

问题是 MinGW/MSYS 似乎无法理解存档中的符号链接。

您可以在提取时使用 --derefence (-h) 选项来解决此问题。

例如

tar -xzvfh archive.tar.gz >http://www.gnu.org/software/tar/manual/html_node/dereference.html

从存档中读取时,--dereference' (-h') 选项会导致 tar 在写入或读取存档中指定的文件时遵循已存在的符号链接。< /p>

The problem is a symbolic link in the archive that MinGW/MSYS does not seem to understand.

You can work around it by using the --derefence (-h) option when extracting.

For example tar -xzvfh archive.tar.gz

from http://www.gnu.org/software/tar/manual/html_node/dereference.html:

When reading from an archive, the --dereference' (-h') option causes tar to follow an already-existing symbolic link when tar writes or reads a file named in the archive.

晚雾 2024-12-09 09:45:24

我也有同样的问题。
由于问题是在构建测试时,我只是没有进行测试:

make Makefile openssl.pc libssl.pc libcrypto.pc build_libs build_apps build_tools

这是一个可怕的解决方案,但它似乎有效。您获得了库和工具,但没有获得测试套件。

我希望有人给出更好的答案和/或修复代码问题(如果有)。

I am having the same problem.
As the problem is while building the tests, I just did not make them:

make Makefile openssl.pc libssl.pc libcrypto.pc build_libs build_apps build_tools

Is a horrible solution but it seems to work. You get the libraries and the tools, but not the test suite.

I hope someone gives a better answer and/or fixes the problem with the code if there is any.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文