8

When compiling in VC6 I am receiving the error:

(fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory)

Can anyone explain why I am receiving this error?

John Hascall
  • 9,176
  • 6
  • 48
  • 72
user2831683
  • 967
  • 1
  • 10
  • 21
  • does int `#include` line say `"stdint.h"`? or `` – doctorlove Dec 06 '13 at 15:29
  • 1
    See http://stackoverflow.com/questions/12970293/why-microsoft-visual-studio-cannot-find-stdint-h/12970619#12970619 and http://stackoverflow.com/questions/6688895/does-microsoft-visual-studio-2010-support-c99/6689014#6689014 – David Conrad Dec 18 '13 at 19:54
  • 1
    Apparently Microsoft only supports C89, although I think VC6 was released in 1998, so it couldn't be expected to support C99 anyway. But even in their latest compilers, Microsoft doesn't support C99. – David Conrad Dec 18 '13 at 19:58

1 Answers1

1

I had a similar issue:

C:\Users\<myuser>\Desktop\Putty For Windows\windows>nmake -f Makefile.vc

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl /Fo  /nologo /W3 /O1 -I..\./ -I..\charset/ -I..\windows/ -I..\unix/ /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500 /D_CRT_SECURE_NO_WARNINGS /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE /DHAS_GSSAPI  /c ..\marshal.c ..\utils.c
marshal.c
c:\users\<myuser>\desktop\putty for windows\defs.h(15) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
utils.c
c:\users\<myuser>\desktop\putty for windows\defs.h(15) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
Generating Code...
NMAKE : fatal error U1077: '"C:\Users\<myuser>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.EXE"' : return code '0x2'
Stop.

I found this answer which mention that using VS 2017 Command prompt can help. I used 2008 so I searched for 2017.

For those who has Visual Studio 2017 and can't find the Command prompt like me, open CMD and run: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"

Notice that I had the folder named Enterprise, but you might have a different folder (maybe Community or something else).

After that, I ran it and it worked good:

C:\Users\<myuser>>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.27
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

C:\Users\<myuser>>cd C:\Users\<myuser>\Desktop\Putty For Windows\windows

C:\Users\<myuser>\Desktop\Putty For Windows\windows>nmake -f Makefile.vc

I also created a shortcut with this command:

C:\Windows\SysWOW64\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"  

Placed it here:

C:\Users\<myuser>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs  

Credit to this answer.

E235
  • 11,560
  • 24
  • 91
  • 141
  • Doesn't answer why the header wasn't available in antique VC6. The answer is simply that the compiler is far too old. – Lundin May 13 '22 at 13:10