One of the C headers contained #define NULL ((void *)0) which is standard for C but not for C++. Normally NULL is defined inside vcruntime.h (part of Visual C++). Using the legacy NULL before any code that depends on vcruntime.h, like string.h, stdio.h, caused this error. Removing the custom definition or changing it to the following solved the problem, see also my answer on StackOverflow:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Proper definition of NULL in C++ code. Taken from vcruntime.h (part of Visual C++) | |
#ifndef NULL | |
#ifdef __cplusplus | |
/*C++ NULL definition*/ | |
#define NULL 0 | |
#else | |
/*C NULL definition*/ | |
#define NULL ((void *)0) | |
#endif | |
#endif |