Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005383OCaml~DO NOT USE (was: OCaml general)public2011-10-24 07:252013-08-31 12:46
Assigned Toprotz 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version3.13.0+dev 
Summary0005383: Cannot build OCaml 3.12.1 Win32/MSVC
DescriptionThe OCamk 3.12.1 Win32/MSVC build is failed, using Microsoft VS 2005 (I was following instructions from README.win32).
When building 'make -f Makefile.nt world', the following error happens:

../../../ -o ocamlbrowser.exe -I ../../../otherlibs/win32unix -I ../
../../otherlibs/str -I ../../../otherlibs/systhreads -I ../labltk -I ../lib -I .
./support -I ../../../parsing -I ../../../utils -I ../../../typing \
                ../../../toplevel/toplevellib.cma \
                unix.cma str.cma threads.cma -custom -ccopt "-link /subsystem:wi
ndows" labltk.cma jglib.cma \
                list2.cmo useunix.cmo setpath.cmo lexical.cmo file
select.cmo searchid.cmo searchpos.cmo shell.cmo help.cmo viewer.cmotyp
echeck.cmo editor.cmo main.cmo winmain.obj
** Cannot resolve symbols for ../../../otherlibs/systhreads\libthreads.lib(st_st

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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
protz (manager)
2011-12-21 11:39


Thanks for reporting this. Can you provide any explanation as to why this is failing now?
- Is it a Makefile issue (wrong compilation order)?
- Is it something else?

I'm not familiar with MSVC but it seems weird that we should be defining something private (starting with _).


avlasov (reporter)
2011-12-21 12:44

Defining _WIN32_WINNT is a standard Microsoft way to specify the minimum system required.
In this case, for TryEnterCritcalSection the minimum version required is Windows 2000, so one should define _WIN32_WINNT as 0x0400 or later.
See [^] for details.

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.
protz (manager)
2011-12-21 14:05

That's a good justification, thanks :-). Could you possibly submit a patch against latest HEAD, using diff --git?


xleroy (administrator)
2012-01-19 20:30

To be fixed as suggested by the reporter. Thanks.
protz (manager)
2012-01-30 16:23

Fixed in r12100 (trunk) and r12101 (version/3.12).

- Issue History
Date Modified Username Field Change
2011-10-24 07:25 avlasov New Issue
2011-12-21 11:39 protz Note Added: 0006435
2011-12-21 12:44 avlasov Note Added: 0006441
2011-12-21 14:05 protz Note Added: 0006442
2012-01-19 20:30 xleroy Note Added: 0006739
2012-01-19 20:30 xleroy Status new => confirmed
2012-01-30 16:23 protz Note Added: 0006845
2012-01-30 16:23 protz Status confirmed => resolved
2012-01-30 16:23 protz Fixed in Version => 3.13.0+dev
2012-01-30 16:23 protz Resolution open => fixed
2012-01-30 16:23 protz Assigned To => protz
2013-08-31 12:46 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker