【发布时间】:2020-12-06 14:35:15
【问题描述】:
我正在尝试在我的 Windows 10 机器上编译 PuTTY for Windows。下载source code 后,我按照自述文件中的步骤操作:
For building on Windows:
- windows/Makefile.vc is for command-line builds on MS Visual C++
systems. Change into the `windows' subdirectory and type `nmake
-f Makefile.vc' to build all the PuTTY binaries.
我需要将以下路径添加到PATH 环境变量中:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64
因为Makefile.vc 在没有绝对路径的情况下调用rc。
我运行 make 文件并收到以下错误:
C:\Users\myuser\Desktop\Putty For Windows\windows>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f Makefile.vc
Microsoft (R) Program Maintenance Utility Version 14.00.24234.1
Copyright (C) Microsoft Corporation. All rights reserved.
rc /Fopageant.res -r -I..\./ -I..\charset/ -I..\windows/ -I..\unix/ -DWIN32 -D_WIN32 -DWINVER=0x0400 ..\windows\pageant.rc
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation. All rights reserved.
..\windows\rcstuff.h(15) : fatal error RC1015: cannot open include file 'winresrc.h'.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\rc.EXE"' : return code '0x1'
Stop.
它写道它无法打开包含文件winresrc.h。
PuTTY 源文件夹中不存在此文件,因此我尝试从我的 Windows 10 SDK 路径复制该文件:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winresrc.h
但即使我将包含文件复制到Putty For Windows\windows 的文件夹后,我也收到了同样的错误。
【问题讨论】:
-
nmake -f makefile.vc必须在为安装 VC++(或 VC++ 构建工具)配置的 cmd 提示符下运行,这不仅意味着 PATH,还意味着 INCLUDE、LIB 和整个环境。打开developer command prompt 并在该提示符处运行nmake命令。 -
@dxiv 谢谢,它有效。请将其发布为答案,我会将其标记为已解决
标签: c windows makefile compiler-errors putty