nmake编译错误

发布于 2024-11-09 14:10:33 字数 1782 浏览 0 评论 0原文

我对 C 非常陌生,正在尝试编译为 Apache 的特定 .so 模块,但我遇到了问题。

我得到的来自 nmake 的致命错误附在下面。命令前面的“cl”从何而来?我执行的批处理文件也被附加。

任何帮助将不胜感激。

Windows 命令行输出

    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.

修改后的 make.bat 来自 这里

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 

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 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不回头走下去 2024-11-16 14:10:33

cl是vs c编译器,报错说找不到编译器。我想问题就在这里:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文