64 位 Windows 上的 OpenSSL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15626852/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
OpenSSL on 64bit Windows
提问by anonim
I am trying to build and link OpenSSL on Windows 8 and I've found it really daunting. I should mention that I am aware of following posts
我正在尝试在 Windows 8 上构建和链接 OpenSSL,我发现它真的令人生畏。我应该提到我知道以下帖子
- OpenSSL Windows x64 Compilation error
- How do you compile OpenSSL for x64?
- Building OpenSSL VC++ Static 64bit Libs
but none of them addressed what I do really need to know. Therefore I decided to share my experience with you guys as a new post!
但他们都没有解决我真正需要知道的事情。因此,我决定以新帖子的形式与大家分享我的经验!
First, I can successfully build and link OpenSSL on a Win32 OS and it perfectly works. I know that Windows 8comes with WOW64. “WOW64 is an x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows”, though when I run my app that is built on windows 7 32-bit, I receive an error “The program can't start because libeay32.dll is missing from your computer…” while “libeay32.dll” is apparently there and not missing.
首先,我可以在 Win32 操作系统上成功构建和链接 OpenSSL,并且它完美运行。我知道Windows 8带有WOW64。“ WOW64 是一个 x86 模拟器,它允许基于 32 位 Windows 的应用程序在 64 位 Windows 上无缝运行”,但是当我运行我的应用程序是在 32 位 Windows 7 上构建时,我收到一个错误“程序可以”启动是因为您的计算机缺少 libeay32.dll ……”而“ libeay32.dll”显然存在并且没有丢失。
In order to avoid registry missing stuffs, I tried to build OpenSSL in 32bit mode on Windows 8. The build was successfully done and the app linked correctly with no error. Again when I run the app I received the same error message.
为了避免注册表丢失的东西,我尝试在 Windows 8 上以 32 位模式构建 OpenSSL。构建成功完成,应用程序正确链接,没有错误。再次运行该应用程序时,我收到了相同的错误消息。
And then I tried to build it in 64bit mode based on the following steps;
然后我尝试基于以下步骤以 64 位模式构建它;
set PATH=%PATH%;c:\perl\bin;c:\nasm;
call "c:\visual studio12\vc\vcvarsall.bat" x64
perl Configure VC-WIN64A no-shared no-idea
call ms\do_win64a
copy ms\libeay32.def ms\libeay64.def /Y
copy ms\ssleay32.def ms\ssleay64.def /Y
ssed -e s/out32/out64/g ms\ntdll.mak | ssed … > ms\ntdll-64.mak
ssed -e s/out32/out64/g ms\nt.mak | ssed … > ms\nt-64.mak
nmake -f ms\ntdll-64.mak
nmake -f ms\ntdll-64.mak test
nmake -f ms\ntdll-64.mak install
In this case, I received a lot of warnings mostly on “data conversion and possibility of data loss” during build but it was built and while “test” failed “install” generated outputs.
在这种情况下,我在构建期间收到了很多警告,主要是关于“数据转换和数据丢失的可能性”,但它是构建的,而“测试”失败“安装”生成了输出。
Now when I try to build my solution in Visual Studio using new “libeay64.lib and ssleay64.lib” I receive almost thousands of errors saying “unresolved external symbol”
现在,当我尝试使用新的“ libeay64.lib 和 ssleay64.lib”在 Visual Studio 中构建我的解决方案时,我收到了几乎数千个错误提示“未解析的外部符号”
So if possible please answer following questions;
因此,如果可能,请回答以下问题;
- Why I cannot run my 32bit app on Windows 8 (64bit)?
- Why correctly built OpenSSL (32bit mode) on Windows 8, still encounters same error?
- In OpenSSL build (64bit mode), am I making something wrong?
- 为什么我无法在 Windows 8(64 位)上运行我的 32 位应用程序?
- 为什么在 Windows 8 上正确构建 OpenSSL(32 位模式),仍然遇到相同的错误?
- 在 OpenSSL 构建(64 位模式)中,我做错了什么吗?
I am using OpenSSL ver 1.0.1e, Visual Studio 2012and nasm 2.10.07
我使用的是OpenSSL 1.0.1e 版、Visual Studio 2012和nasm 2.10.07
Thanks
谢谢
回答by doptimusprime
I am partially answering your question:
我部分回答你的问题:
You can run 32-bit under 64-bit in WOW64.
在 WOW64 中,您可以在 64 位下运行 32 位。
For OpenSSL under 64-bit, there is a compiler option /WX under visual studio which means treat warnings as an error. Remove that compiler option from the makefile. You will get lots of warnings. But OpenSSL will get compiled.
对于 64 位下的 OpenSSL,visual studio 下有一个编译器选项 /WX,这意味着将警告视为错误。从 makefile 中删除该编译器选项。你会收到很多警告。但是 OpenSSL 会被编译。
Since, most of the modules are not compiled and their object file is not generated, that is why you are getting linker error. Please let me know if it solves your problem.
因为,大多数模块都没有编译,也没有生成它们的目标文件,这就是你收到链接器错误的原因。如果它解决了您的问题,请告诉我。