Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007263OCamlplatform support (windows, cross-compilation, etc)public2016-05-23 13:242016-09-27 21:39
Assigned To 
PrioritynormalSeverityblockReproducibilityhave not tried
PlatformOSOS Version
Product Version4.02.3 
Target Version4.04.0 +dev / +beta1 / +beta2Fixed in Version4.04.0 +dev / +beta1 / +beta2 
Summary0007263: Build with MSVC-14 (Visual Studio 2015) / Windows 10 not possible
DescriptionThe suggested Win 7 SDK (in README.win32) does not install under Win 10. Because of that I tried it with something newer, namely MSVC 14 Express For Desktop with Win 10 SDK.

However, this leads to a problem:

$ make -f Makefile.nt world
cd byterun ; make -f Makefile.nt all
make[1]: Entering directory '/home/gerd/tmp/ocaml-4.02.3/byterun'
flexlink -merge-manifest -stack 16777216 -exe -o ocamlrun.exe prims.obj ws2_32.lib \
** Cannot resolve symbols for descriptor object:
Steps To ReproduceFind attached my script for setting the environment variables.
Additional InformationThis could be an incompatibility of the libraries distributed with flexlink, because I find there the symbols __imp__sprintf and __imp____iob_func. See also this Stack Overflow article: [^]
Attached Files? file icon [^] (1,973 bytes) 2016-05-23 13:24

- Relationships

-  Notes
gerd (reporter)
2016-05-23 13:33

In deed, when I rebuild flexdll_msvc.obj and flexdll_initer_msvc.obj, the error vanishes:

cl /nologo /MD -D_CRT_SECURE_NO_DEPRECATE /GS- /DMSVC -c /Fo"flexdll_msvc.obj" flexdll.c
cl /nologo /MD -D_CRT_SECURE_NO_DEPRECATE /GS- /DMSVC -c /Fo"flexdll_initer_msvc.obj" flexdll_initer.c
gerd (reporter)
2016-05-23 14:01

msvcrt.lib is no longer sufficient. You also need to link in ucrt.lib and vcruntime.lib ( [^])

I changed MKEXE in config/Makefile as follows:
MKEXE=$(FLEXLINK) -exe ucrt.lib vcruntime.lib
gerd (reporter)
2016-05-23 14:05

Also, there is now snprintf, and you get an error if you try to #define it:

cl -nologo -D_CRT_SECURE_NO_DEPRECATE -Feobjinfo_helper.exe -Ox -MD \
C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition
c:\cygwin\home\gerd\tmp\ocaml-4.02.3\byterun\caml\misc.h(163): note: Siehe vorherige Definition von "snprintf"
C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration

Solution: commented "#define snprintf caml_snprintf" out in byterun/caml/misc.h
gerd (reporter)
2016-05-23 15:08

With these fixes I could complete the build.
dra (developer)
2016-07-01 13:46

This is a bug (of sorts) in the binary distro of FlexDLL - there's a move (prompted by VS2015 support) towards the "binary" distribution of FlexDLL being flexlink.exe and the .c files.
README.win32.adoc in 4.03.0 includes more comprehensive instructions.
doligez (administrator)
2016-09-27 15:50

In 4.04, I've added a note to README.win32.adoc to say that you must recompile FlexDLL from source if you're using VS2015. The snprintf thing was fixed by @dra in commit 12a9af9d.

This seems to be enough to fix it all, although the FlexDLL makefile still gives some error messages when trying to get the OCaml version number.
dra (developer)
2016-09-27 21:39

The problem with the FlexDLL Makefile should be harmless as long as you're building OCaml 4.03.0 or later. It's also fixed in master (and so 0.36)

- Issue History
Date Modified Username Field Change
2016-05-23 13:24 gerd New Issue
2016-05-23 13:24 gerd File Added:
2016-05-23 13:33 gerd Note Added: 0015947
2016-05-23 14:01 gerd Note Added: 0015948
2016-05-23 14:05 gerd Note Added: 0015949
2016-05-23 15:08 gerd Note Added: 0015950
2016-06-07 16:53 doligez Tag Attached: patch
2016-07-01 13:46 dra Note Added: 0016026
2016-09-27 14:01 doligez Status new => acknowledged
2016-09-27 14:01 doligez Target Version => 4.04.0 +dev / +beta1 / +beta2
2016-09-27 15:50 doligez Note Added: 0016328
2016-09-27 15:50 doligez Status acknowledged => resolved
2016-09-27 15:50 doligez Resolution open => fixed
2016-09-27 15:50 doligez Fixed in Version => 4.04.0 +dev / +beta1 / +beta2
2016-09-27 21:39 dra Note Added: 0016343
2017-02-23 16:46 doligez Category OCaml windows => platform support (windows, etc)
2017-02-23 17:16 doligez Category platform support (windows, etc) => platform support (windows, cross-compilation, etc)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker