3

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
  • 1
    Did you run all pre-requisites commands mentioned in INSTALL file of windows? Which version of OpenSSL are you trying to compile? Commented Sep 16, 2009 at 21:24
  • Yes. I am following the steps from INSTALL.W32. > perl Configure VC-WIN32 --prefix=c:/some/openssl/dir > ms\do_ms and it failed in the next step: nmake -f ms\ntdll.mak Commented Sep 17, 2009 at 13:11

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

2 Comments

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.
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.