Builds on Windows seems to fail with an linker error when in recent versions of Crypto++, I have read the README.txt and could not find any further instructions on how to build it. As far as I know there my VS 2017 C++ setup is as standard as you can get.
Steps to reproduce:
Expected result: The solution should build as intended
Actual result:
The solution fail to build with the error:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'stddef.h': No such file or directory cryptlib c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\cstddef 7
The issue above was on my work machine - tested to build Crypto++ 8.0 on my personal machine using the same steps and it worked as intended.
Will look into what difference there is between the setups.
I found the solution to the problem - Windows Universal CRT SDK must be installed.
Steps to fix the problem:
Individual Component -> Windows Universal CRT SDKThanks @robinwassen,
That's kind of a weird build error in 2019. It does not seem like you should need a SDK to build with a standard header like <stddef.h> or <cstddef>. <stddef.h> is Posix, and it provides uintptr_t, size_t, ptrdiff_t and a few other types.
I wonder if there's anything we can do to avoid the build failure.
Here's the cause of the error in stdcpp.h:
#include <cstdlib>
#include <cstddef>
#include <cstring>
#include <climits>
#include <cmath>
// uintptr_t and ptrdiff_t
#if defined(__SUNPRO_CC)
# if (__SUNPRO_CC >= 0x5100)
# include <stdint.h>
# endif
#elif defined(_MSC_VER)
# if (_MSC_VER >= 1700)
# include <stdint.h>
# else
# include <stddef.h>
# endif
#elif (__cplusplus < 201103L)
# include <stdint.h>
#endif
@noloader I am not sure it's worth mitigating this in Crypto++ when I saw what the solution was, if someone else bumps into this problem I guess this issue will show up on Google which should be enough.
But I agree that it's really odd that those header files was inaccessible, because I have built a lot of other C++ projects on the same machine.
It looks like someone else is having trouble: Compiling Crypto++ Library on Visual Studio 2017 Targeting Windows 10.
It is time to act.
@noloader Still had the same issue. After changing Visual Studio Installation as @robinwassen suggested the bug was fixed. So your fix didn't work for me (Win7, VS2017).
Most helpful comment
I found the solution to the problem - Windows Universal CRT SDK must be installed.
Steps to fix the problem:
Individual Component -> Windows Universal CRT SDK