使用 MinGW/MSYS 编译 OpenSSL 时出错
从OpenSSL 官方网站下载源文件。我遵循 OpenSSL 文件夹中的 INSTALL.M32 文件。我打开 msys.bat,转到 OpenSSL 文件夹,然后键入
$ ./config
它显示“Configured for MinGW”,然后我键入
$ make
,几分钟后收到错误:
md2test.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我只是打开导致错误的文件 (/test/"md5test.c; rc5test.c; jpaketest.c") 并将该行替换
为
它与上述解决方案相同,只是速度更快一点......
I simply opened the files that were causing the error (/test/"md5test.c; rc5test.c; jpaketest.c") and replaced the line
to
It's the same solution as stated above, except it's a bit faster...
问题在于,
md2test.c
实际上是一个符号链接,或者是dummytest.c
的符号链接。如果您使用其他任何东西提取
openssl-1.0.1c.tar.gz
,那么这些符号链接将不会被保留。在 Cygwin 上它之后就可以工作了;不确定 MinGW。
The problem is that
md2test.c
is actually a symbolic link, or symlink todummytest.c
.If you extracted
openssl-1.0.1c.tar.gz
with anything other thanthen these symlinks were not preserved. On Cygwin it works after that; not sure about MinGW.
就我而言,问题是很少有测试文件(据我记得有 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.
你用什么程序解压'openssl-1.0.0x.tar.gz'? 7-zip 是一个很棒的程序,但似乎有一个错误。
使用 tar 或其他解压缩程序,例如 BreadZip。
它与上面所述的解决方案相同,只是速度更快一点......:)
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.
It's the same solution as stated above, except it's a bit faster... :)
问题是 MinGW/MSYS 似乎无法理解存档中的符号链接。
您可以在提取时使用
--derefence
(-h
) 选项来解决此问题。例如
tar -xzvfh archive.tar.gz >http://www.gnu.org/software/tar/manual/html_node/dereference.html:
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:
我也有同样的问题。
由于问题是在构建测试时,我只是没有进行测试:
这是一个可怕的解决方案,但它似乎有效。您获得了库和工具,但没有获得测试套件。
我希望有人给出更好的答案和/或修复代码问题(如果有)。
I am having the same problem.
As the problem is while building the tests, I just did not make them:
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.