microsoft / Range-V3-VS2015

A fork of the popular range-v3 C++ library with support for the Visual Studio 2015 Update 3 VC++ compiler.
Other
115 stars 22 forks source link

calendar fails in VS2015 Update 3 #8

Open mambolevis opened 7 years ago

mambolevis commented 7 years ago

Hi,

I build the library using VS2015 Update 3. The library was build without problem. Nonetheless, the calendar example failed.

Now, I'm trying to build the calendar example in my own build system using the following pre-processor and compiler flags:

PREFLAGS = /D "WIN32" /D "_WINDOWS" /D "Boost_USE_STATIC_LIBS=1" \
                     /D "Boost_USE_MULTITHREADED=1" /D "Boost_USE_STATIC_RUNTIME=0"

CGFLAGS=/c /EHsc /W1 /nologo /MTd /std:c++latest

The message that I obtained are very difficult to follow (at least for me).

I really appreciate if you can give me a piece of advice. I'm waiting long time to build the library and learn from it.

Attached, the compiler messages. Thanks a lot.

Regards,

Levis calendar_compiler_output.txt

ericniebler commented 7 years ago

Do you have an easy way to get the error messages in English?

CaseyCarter commented 7 years ago

My mistake: this is a known bug that I failed to file an issue for here: VS2015 Update 3 can't quite compile the calendar example.

  1. friend-related name lookup bugs result in a recursive template specialization (i.e., a specialization that indirectly depends on itself). You can change the #if 0 on line 96 of calendar.cpp to a 1 to avoid this particular problem by instantiating a couple of iterators ahead of time.
  2. this program - more so even than test/action/split.cpp - causes the compiler to consume truly massive amounts of memory space (~20GB). It needs an x64-hosted toolset to compile successfully.
mambolevis commented 7 years ago

Unfortunately, all messages are shown in German. I would like to have the possibility of using a flag to setup the language, something like: /D "Language=English" but I didn't find it.

CaseyCarter commented 7 years ago

Attached, the compiler messages. Thanks a lot.

The early errors in the boost headers that reference std::unary_function and std::binary_function are caused by /std:c++latest disabling the definitions of those standard facilities that have been removed in C++17. You can avoid that by defining _HAS_AUTO_PTR_ETC to 1 to tell the VC++ STL to define those facilities even with /std:c++latest.

mambolevis commented 7 years ago

When I use the VS2015 IDE the messages are shown in English. On the other hand, when using NMAKE, error messages are shown in German.

Question: how can I set up the language to see NMAKE error messages in English?

mambolevis commented 7 years ago

I added the flag _HAS_AUTO_PTR_ETC , so my flags are:

PREFLAGS = /D "WIN32" /D "_WINDOWS" /D "Boost_USE_STATIC_LIBS=1" \
           /D "Boost_USE_MULTITHREADED=1" /D "Boost_USE_STATIC_RUNTIME=0" \
           /D "_HAS_AUTO_PTR_ETC=1"

Some errors disapered, now the output file looks like: calendar_error_output_2.txt

CaseyCarter commented 7 years ago

calendar_error_output_2.txt

The C4503 warnings are about overlong symbol names. The MS C++ ABI doesn't store symbols whose mangled length is over two thousand (IIRC) characters long, it instead hashes the long symbol name and uses the hash result in its stead. Range-v3 often generates enormous symbols and triggers C4503; I suggest disabling the warning with /wd4503.

mambolevis commented 7 years ago

I suggest disabling the warning with /wd4503.

With this switch the size of the error output file is reduced substantially: calendar_error_output_3.txt

Until now I'm following all your suggestions except this one: You can change the #if 0 on line 96 of calendar.cpp to a 1 because it blocks my build system.

My compiler flags are: CGFLAGS=/c /EHsc /W1 /wd4503 /nologo /MTd /std:c++latest

Question: how can I set up the language to see NMAKE error messages in English? In the case that you don't know how to do it, please let me know who can I contact?

CaseyCarter commented 7 years ago

Question: how can I set up the language to see NMAKE error messages in English? In the case that you don't know how to do it, please let me know who can I contact?

The two suggestions I have that may work are (1) change the currently selected language pack in Windows to English, or (2) try changing the console codepage to 437 with "chchp 437".

CaseyCarter commented 7 years ago

With this switch the size of the error output file is reduced substantially: calendar_error_output_3.txt

Yes, those are exactly the expected errors.

mambolevis commented 7 years ago

The two suggestions I have that may work are (1) change the currently selected language pack in Windows to English, or (2) try changing the console codepage to 437 with "chchp 437".

The first option works directly, with the disadvantage that it is necessary to restart the OS. The second didn't work. So, here is the English version: calendar_error_output_3_English.txt

What I find interesting is this scenario: My OS is in German, VS IDE is in English and IDE's error messages are in English (perfect). Nonetheless, NMAKE error messages are in German. I need to find one way to obtain NMAKE output errors in English without changing the OS language. Any suggestion?

Yes, those are exactly the expected errors. I suppose that it is necessary to wait a little bit more to be able to build the calendar example?

Thanks!