在 Windows 上编译 OpenSSL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1435431/
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
Compiling OpenSSL on windows
提问by zkarthik
Quoting the instructions for building OpenSSL:
引用构建 OpenSSL 的说明:
Then from the VC++ environment at a prompt do:
nmake -f ms\ntdll.mak
然后在提示下从 VC++ 环境中执行:
nmake -f ms\ntdll.mak
When I do this, I get
当我这样做时,我得到
cl /Fotmp32\cryptlib.obj -Iinc32 -Itmp32 /MT /Ox /O2 /Ob2 /W3 /WX /Gs0
/GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_W
IN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE /Fdout32 -DOPENSSL_N
O_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_CMS
-DOPENSSL_NO_JPAKE -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_KRB5 -DOPENSSL_NO_DYNAMIC_
ENGINE /Zl -c .\crypto\cryptlib.c
cryptlib.c
tmp32\e_os.h(438) : fatal error C1083: Cannot open include file: 'unistd.h': No
such file or directory
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.EXE"' : return code '0x2'
Stop.
Looks like I am missing setup of some environment variable that will point to where unistd.h. Not sure what it is though.
看起来我缺少一些环境变量的设置,这些变量将指向 unistd.h 的位置。不确定它是什么。
采纳答案by Mihai Limb??an
Copy C:\Program Files\Microsoft Visual Studio 9.0\VC\Include\io.h
under the name unistd.h
in the same directory and retry the build.
在同一目录中C:\Program Files\Microsoft Visual Studio 9.0\VC\Include\io.h
的名称下复制unistd.h
并重试构建。
回答by Stephen C. Steel
Look in the Common7/Tools subdirectory where Visual Studio is installed (for a typical installation C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools) for a batch file named vsvars32.bat. When you open a command prompt, run this batch file. It will define environment variables pointing to various installation directories, including where various standard header files are installed.
在安装 Visual Studio 的 Common7/Tools 子目录中查找名为 vsvars32.bat 的批处理文件(典型安装为 C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools)。当您打开命令提示符时,运行此批处理文件。它将定义指向各种安装目录的环境变量,包括安装各种标准头文件的位置。