I'm working on compiling NetHack in Visual Studio 2015 on Windows 7.
I'm getting the following error (all preceded with c:\program files (x86)\windows kits\10\include\10.0.10586.0\um\memoryapi.h
:
3>(815): error C2143: syntax error: missing ')' before '.'
3>(815): error C2059: syntax error: ')'
3>(816): error C2059: syntax error: ')'
Here is the context in the source:
805 #if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
806
807 WINBASEAPI
808 _Ret_maybenull_ _Post_writable_byte_size_(Size)
809 PVOID
810 WINAPI
811 VirtualAllocFromApp(
812 _In_opt_ PVOID BaseAddress,
813 _In_ SIZE_T Size,
814 _In_ ULONG AllocationType,
815 _In_ ULONG Protection
816 );
This is confusing because #1, there's a compiler directive that is supposed to prevent this section of code from being used--I'm running Windows 7, and #2, the first error, missing ')' before '.'
makes no sense because there is no .
in the source code. How do I proceed?
When I search the whole solution for _WIN32_WINNT
Visual Studio can't find it—bizarre! I did find WINPFLAG = -DTILES -DMSWIN_GRAPHICS -DWIN32CON -D_WIN32_IE=0x0400 -D_WIN32_WINNT=0x0501
. However, _WIN32_WINNT_WIN10
doesn't appear to be defined, though presumably it's defined by the system (?). Trying to define it myself as 0x0A00, but uncommenting the above code yielded the same errors again.
Now I'm getting Error C2733 'terminate': second C linkage of overloaded function not allowed NetHack nethack\include\extern.h 643
:
E void FDECL(terminate, (int)) NORETURN;
I searched the whole solution again with Notepad++ and this is the only occurrence (strangely, VS itself is still having problems finding these things with global search).