Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot build OCaml 3.12.1 Win32/MSVC #5383
Original bug ID: 5383
The OCamk 3.12.1 Win32/MSVC build is failed, using Microsoft VS 2005 (I was following instructions from README.win32).
../../../ocamlcomp.sh -o ocamlbrowser.exe -I ../../../otherlibs/win32unix -I ../
The problem actually can be easily fixed by inserting '#define _WIN32_WINNT 0x0400' before '#include <windows.h>' in the file otherlibs\systhreads\st_win32.h.
For some reason st_stubs.obj has been compiled earlier, while TryEnterCriticalSection normally require _WIN32_WINNT >= 0x0400 to be defined.
Comment author: @protz
Thanks for reporting this. Can you provide any explanation as to why this is failing now?
I'm not familiar with MSVC but it seems weird that we should be defining something private (starting with _).
Comment author: avlasov
Defining _WIN32_WINNT is a standard Microsoft way to specify the minimum system required.
Actually, another file in OCaml 3.12.1 source code otherlibs\win32unix\winworker.h already defines _WIN32_WINNT as 0x0400.
If the appropriate _WIN32_WINNT version is not defined, then compiling files referencing TryEnterCriticalSection should normally fail, since it is not in the original WIN32, but was added later.