nmake compilation error

Cel picture Cel · May 24, 2011 · Viewed 10.6k times · Source

I'm very new to C and am trying to compile to a specific .so module for Apache, but I'm running into problems.

The fatal error from nmake I get is appended below. Where does the prepend of "cl" to the command come from? The batch file that I execute is also appended.

Any help would be dearly appreciated.

Windows command-line output

    cl /nologo /W3 /WX /LD /MT /Ot /Ox /Oi /Oy /Ob2 /GF /Gy /I include  /I "..\httpd\i
nclude" /I "..\httpd\srclib\apr\include" /I "..\httpd\srclib\apr-util\include" /I "..\http
d\os\win32" /I "C:\Program Files\Microsoft SDKs\Windows\v7.0A\include" /I "C:\Program File
s\Microsoft Visual Studio 10.0\VC\include" /D WIN32 /c %CD%\src\mod_auth_sspi.c /FoRelease
\mod_auth_sspi.obj
'cl' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'cl' : return code '0x1'
Stop.

Modified make.bat from here

echo off

::Configuration Area
set PLATSDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.0A
REM I could not find SetEnv anywhere for Win7 / VS2010:
REM set SDK_Init=c:\Programs\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.Cmd
REM maybe could use setx XXX somehow for the above?
set MSVCDIR=C:\Program Files\Microsoft Visual Studio 10.0\VC
set NMAKE_Opts=/NOLOGO
set APACHE22_HOME=..\httpd
REM i am not sure what the meaning of the above paramater is, do i need to point to apache source code or apache server to compile?
set APSRC=1
set NMAKEHOME=C:\Program Files\Microsoft Visual Studio 10.0\VC\bin
set BUILD_TYPE=Release
set DEBUG=0

REM %SDK_Init% not set so have commented this out 
REM call "%SDK_Init%" /%BUILD_TYPE%
call "%NMAKEHOME%\nmake" %NMAKE_Opts% "MSVCDIR=%MSVCDIR%" "PLATSDKDIR=%PLATSDKDIR%" "APACHE22_HOME=%APACHE22_HOME%" "APSRC=%APSRC%" "DEBUG=%DEBUG%" dist
@echo.
pause 

Answer

BlackBear picture BlackBear · May 24, 2011

cl is the vs c compiler, and the error says it can't find the compiler. I guess the issue is here:

call "%NMAKEHOME%\nmake" %NMAKE_Opts% "MSVCDIR=%MSVCDIR%" "PLATSDKDIR=%PLATSDKDIR%" "APACHE22_HOME=%APACHE22_HOME%" "APSRC=%APSRC%" "DEBUG=%DEBUG%" dist