Reputation: 13440
I am trying to compile PuTTY for Windows on my Windows 10 machine. After I download the source code, I followed the steps from the README file:
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.
I needed to add the following path to the PATH
environment variable:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64
Because the Makefile.vc
is calling rc
without absolute path.
I run the make file and received the following error:
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.
It writes that it can't open the include file winresrc.h
.
This file doesn't exist in the PuTTY source folder, so I tried to copy the file from my Windows 10 SDK path:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winresrc.h
But I received the same error even after I copied the include file to the folder of Putty For Windows\windows
.
Upvotes: 1
Views: 964
Reputation: 17638
nmake -f makefile.vc
must be run at a cmd prompt configured for an installation of VC++ (or the VC++ build tools), and that means not just the PATH but also INCLUDE, LIB etc. It will work if run at a VS developer command prompt, which sets the whole environment correctly.
As an alternative, the PuTTY for Windows package comes with Visual C++ .sln
and .vcxproj
project files for building from the IDE. The windows\vs2012\putty.sln
solution imports fine into the latest VS 2019, and builds (albeit with many warnings) after fixing the header references in putty-src\windows\version.rc2
.
#include "..\\version.h" // instead of "version.h"
#include "..\\licence.h" // instead of "license.h"
Upvotes: 2