views:

362

answers:

2

Quoting the instructions for building OpenSSL:

Then from the VC++ environment at a prompt do:

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.

+2  A: 

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.

Mihai Limbășan
A: 

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.

Stephen C. Steel
When I ran the bat file, it does say: "Setting environment for using Microsoft Visual Studio 2008 x86 tools." But still nmake -f ms\ntdll.mak give sthe same error.
zkarthik
If it made no difference, then you probably selected the option to add these environment variables to the default environment when you installed Visual Studio (it's optional, as the settings can conflict with outher development tools, but the variables must be set one way or the other for using the command line versions of the tools).Fortunately, Mihai's suggestion seems address the specific problem with OpenSSL.
Stephen C. Steel