Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005383OCamlOCaml generalpublic2011-10-24 07:252013-08-31 12:46
Reporteravlasov 
Assigned Toprotz 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
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:

../../../ocamlcomp.sh -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
camlprim8e0eac.c
** Cannot resolve symbols for ../../../otherlibs/systhreads\libthreads.lib(st_st
ubs_b.obj):
 _TryEnterCriticalSection

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
(0006435)
protz (manager)
2011-12-21 11:39

Hi,

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 _).

Thanks,

jonathan
(0006441)
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 http://msdn.microsoft.com/en-us/library/windows/desktop/ms686857%28v=vs.85%29.aspx [^] 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.
(0006442)
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?

Cheers,

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

To be fixed as suggested by the reporter. Thanks.
(0006845)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker