VS2015 build issues
Hiya,
I'm trying to build ECL on Windows 10 with Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86
I've found the following issues.
fib_table.h throws a precompiler error
.\fib_table.h(4): fatal error C1189: #error: , error, this data is for 64 bits
In msvc/Makefile:362
, BITS should be GMP_NUMB_BITS to prevent this error:
msvc/c/dpp.h
does not compile
..\..\src\c/dpp.c(94): error C2632: 'int' followed by 'bool' is illegal
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
It looks like the issue is that __cplusplus is not defined but that cl is trying to compile as a c99 program (so redefining bool won't work).
I fixed this issue by changing dpp.c at line 93 to:
#ifndef __cplusplus
#if __STDC_VERSION__ >= 199901L
typedef int bool;
#endif
#endif
file.d
does not compile
../../src/c/file.d(5324): error C2039: '_cnt': is not a member of '_iobuf'
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_wstdio.h(26): note: see declaration of '_iobuf'
It looks like this is because Microsoft have intentionally hidden the internals of File: see https://connect.microsoft.com/VisualStudio/feedback/details/1419290/file-is-not-a-member-of-iobuf-bug
I got around this by uncommenting msvc/ecl/config.h.msvc6:421
and commenting the following few lines (which define FILE_CNT).
I also saw
../../src/c/file.d(4603): error C2371: 'ecl_listen_stream': redefinition; different basic types
../ecl/external.h(734): note: see declaration of 'ecl_listen_stream'
../../src/c/file.d(4675): error C2371: 'ecl_interactive_stream_p': redefinition; different basic types
../ecl/external.h(718): note: see declaration of 'ecl_interactive_stream_p'
which I worked around my redefining those methods from int to bool in file.d
.
ecl_min.lib
Linker error in cl /Feecl_min.exe cinit.obj c\all_symbols.obj eclmin.lib /link /incremental:no /nologo /nodefaultlib:libcmt /nodefaultlib:libcmtd /nodefaultlib:libcd /nodefaultlib:msvcrtd.lib eclgc.lib eclgmp.lib user32.lib ws2_32.lib shell32.lib
Creating library ecl_min.lib and object ecl_min.exp
eclmin.lib(ffi.obj) : error LNK2019: unresolved external symbol _ecl_fficall_prepare_extra referenced in function _ecl_fficall_prepare
eclmin.lib(ffi.obj) : error LNK2019: unresolved external symbol _ecl_fficall_push_arg referenced in function _si_call_cfun
eclmin.lib(ffi.obj) : error LNK2019: unresolved external symbol _ecl_fficall_execute referenced in function _si_call_cfun
eclmin.lib(ffi.obj) : error LNK2019: unresolved external symbol _ecl_dynamic_callback_make referenced in function _si_make_dynamic_callback
ecl_min.exe : fatal error LNK1120: 4 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86\cl.EXE"' : return code '0x2'
Stop.
Currently stuck on this.