Question

I have Windows 7 Pro x86 with Visual Studio 2010 Pro. Also I have MinGW in c:\MinGW. I want to build nginx under windows using Visual C++. I follow this guide.

  1. I run cmd under Administrator, then I call "c:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
  2. In cmd I run C:\MinGW\msys\1.0\msys.bat
  3. I cd to nginx source direcotry and run configure script, before I downloaded prerequisites.
  4. Then I run nmake -f objs/Makefile

The result is the following error:

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

'install' is up-to-date
    cl -O2  -W4 -WX -nologo -MT -Zi -DFD_SETSIZE=1024 -DNO_SYS_TYPES_H 
       -Ycng x_config.h -Fpobjs/ngx_config.pch -c -I src/core-I src/event
       -I src/event/mod ules  -I src/os/win32  -I objs/lib/pcre-8.32  
       -I objs/lib/openssl/openssl/include -I objs/lib/zlib-1.2.7  -I objs
       -I src/http  -I src/http/modules -I src/mail -Foobjs/ngx_pch.obj 
       objs/ngx_pch.c ngx_pch.c

    cl -c -O2  -W4 -WX -nologo -MT -Zi -DFD_SETSIZE=1024 -DNO_SYS_TYPES_H 
       -Y ungx_config.h -Fpobjs/ngx_config.pch -I src/core-I src/event  
       -I src/event/mod ules  -I src/os/win32  -I objs/lib/pcre-8.32  
       -I objs/lib/openssl/openssl/include  -I objs/lib/zlib-1.2.7  -I objs
       -I src/http  -I src/http/modules -I src/mail -Foobjs/src/core/nginx.obj
       src/core/nginx.c nginx.c

c:\nginx\source\src\event\ngx_event_openssl.h(15) : fatal error C1083:
Cannot open include file: 'openssl/ssl.h': No such file or directory
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio
10.0\VC\BI N\cl.EXE"' : return code '0x2' Stop.

But OpenSSL is located in C:\nginx\source\objs\lib\openssl

What did I do wrong?

Was it helpful?

Solution

I had the exact same problem.

The problem is related to eol (end of lines) handling of certain files with the Perl build used. You should not use the MSYS Perl build. Instead you should use ActivePerl or StrawberryPerl, as indicated in the guide. Be sure though that the PATH points to the appropriate Perl distribution, prior to the MSYS Perl.

export PATH=/appropriate/perl/dist:$PATH

This answer helped me solve the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top