gpt4 book ai didi

c - nmake编译错误

转载 作者:太空狗 更新时间:2023-10-29 15:41:21 27 4
gpt4 key购买 nike

我是 C 的新手,正在尝试编译为 Apache 的特定 .so 模块,但我遇到了问题。

我从 nmake 得到的 fatal error 附在下面。命令的“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.

修改了来自 here 的 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

最佳答案

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

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

关于c - nmake编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6112727/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com