4

I was about to use PuTTY Development source code for Windows to create my own client application (found here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) but as I tried to compile the PSCP project (SCP Client), I got the following error :

C:\work\2015\Putty\windows\version.rc2 (18): error RC2104 : undefined keyword or key name: BINARY_VERSION

I've been going through the various posts involving this error but didn't find anything working :

error RC2104: undefined keyword or key name: DS_SETFONT :

On this post I noticed that the version of MSVC was brought up so I figured maybe something has to be done to get PuTTY to work on VC 6.0 ?

Also I tried to add #include <windows.h> in both version.rc2 (version.rc2 is used for inclusion in all .rc files) and pscp.rc, none worked.

I'll be quick to answer if you need any information (project properties, source code...)

USING Visual Studio 6.0 with SP6 on Windows 8.1

Community
  • 1
  • 1
  • Any reason you're stuck using Visual Studio 6.0, which is now 17 years old? – Cory Kramer May 12 '15 at 14:00
  • Yes in fact, I'm working on a 18 years old software and this is mandatory... I'd change if only I could. –  May 12 '15 at 14:01

3 Answers3

7

Probably, wrong version.h is seen. Correctly, the file version.h in the project folder should be seen.

Please try to modify version.rc2:

#include "version.h"

to

#include "..\\..\\..\\version.h"

At least, resource compiler will end successfully.

OhBeWise
  • 5,350
  • 3
  • 32
  • 60
  • I tried to modify to `#include "..\\..\\..\\version.h"` on a brand new folder (I redownloaded it) and I'm still getting 116 syntax/undeclared identifier/etc.. errors. Note that all source files are in higher folders (there's nothing in the PSCP project folder but the project), i'm guessing the version.h seen is the only one: the one in the PuTTY folder. –  May 13 '15 at 06:12
  • the version.h file doesn't seem to contain more than 4 variables declaration so I'm wondering how do I manage to get that many **underclared identifier errors** on compiling. –  May 13 '15 at 07:44
2

If you search through the PuTTY source files, you'll notice that BINARY_VERSION is defined in version.h and used in windows/version.rc2, which #includes version.h.

Since your version.rc2 isn't seeing version.h, try to figure out why: Is version.h still present and does it still contain BINARY_VERSION? Are your include paths correct? Is there another version.h somewhere else in your include path that's getting picked up by mistake?

Josh Kelley
  • 56,064
  • 19
  • 146
  • 246
  • version.h was in PuTTY folder and version.rc2 was in PuTTY/windows. version.h still contains `#define BINARY_VERSION 0,64,1074,0`. I tried to move it to PuTTY/windows and indeed the error disappeared. I now have 116 errors and 42 warnings on compiling (syntax, undeclared identifier, etc...) –  May 12 '15 at 14:22
0

Which source code are you using ?

I tested latest(0.64) "Release source code for Windows".

direct link is http://the.earth.li/~sgtatham/putty/latest/putty-src.zip

I had tried to compile using VC++ 6.0 Professional with SP6, on my PC, running Windows XP SP3.

After extracting putty-src.zip to somewhere with keeping folder structures, did you correctly opened 'putty.dsw' in "putty-src\windows\MSVC" folder?

You should be find in 7 projects in 'FileView' tab of the workspace in Visual Studio 6.0.

You can switch active project to 'pscp' with context menu via right button click on 'pscp' project.

With modified version.rc2, resource compiler finished successful. But two (sshshare.c, winsftp.c) C source files failed compiling with 20 errors. in 'pscp' project.

Errors while compiling 'winsftp.c' is caused 'TIME_POSIX_TO_WIN' and 'TIME_WIN_TO_POSIX' macros.

'ull(unsigned long long)' is a 64-bit integer-suffix, newly defined in C99. Since C99 standard is not support on VC6, then caused errors.

I had temporally modified

11644473600ull ------> ((ULONGLONG)11644473600)

10000000ull ---------> ((ULONGLONG)10000000)

and confirmed errors are cleared. (Sorry, no validation the code is correctly generated)

3 errors while compiling 'sshshare.c' is also caused another macro.

I cannot understand why you got 116 errors.

  • I followed those steps a few times now and I always get the exact same amount of errors. Regarding the number of "undeclared identifier" errors, I assumed it had something to do with unseen libraries. I've also been trying to build using the command line `nmake -f Makefile.vc` while in the windows folder, I had the **error C1083**, telling me that he didn't see **htmlhelp.h**. I then tried to install the API, adding the right folders in the Directories setting to include the library, but I still get the same error on building. Based on that, I'd say that I have a huge lack of libraries. –  May 13 '15 at 13:52
  • And I'm using the same Source code as you are, on Windows 8.1. –  May 13 '15 at 13:58