Internal compiler error when compiling program which uses ROOT6 in Visual Studio

Hi,
I’m having trouble compiling my program which uses ROOT6 in Visual Studio 2017. When I include any ROOT6 header files, like this:

#include "TFile.h"
int main(){}

When using default C++14 standart, the compiler crashes with:

1> c:\root6\include\root\libcpp_string_view.h(193): warning C4068: unknown pragma
1>  c:\root6\include\root\typetraits.hxx(43): fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:\dd\vctools\compiler\cxxfe\sl\p1\c\convert.cpp', line 677)
1>   To work around this problem, try simplifying or changing the program near the locations listed above.
1>  Please choose the Technical Support command on the Visual C++
1>   Help menu, or open the Technical Support help file for more information
1>  c:\root6\include\root\typetraits.hxx(46): note: see reference to class template instantiation 'ROOT::Detail::CallableTraitsImpl<T,true>' being compiled

when using the newer c++17 standart:

1>  c:\root6\include\root\libcpp_string_view.h(193): warning C4068: unknown pragma
1>  c:\root6\include\root\libcpp_string_view.h(797): error C3861: 'unary_function': identifier not found
1>  c:\root6\include\root\libcpp_string_view.h(800): note: see reference to class template instantiation 'std::hash<std::experimental::__ROOT::basic_string_view<_CharT,_Traits>>' being compiled
1>  c:\root6\include\root\libcpp_string_view.h(797): error C2143: syntax error: missing ',' before '<'
1>  c:\root6\include\root\rstringview.hxx(32): error C2386: 'basic_string_view': a symbol with this name already exists in the current scope
1>  c:\root6\include\root\typetraits.hxx(43): fatal error C1903: unable to recover from previous error(s); stopping compilation

When using ROOT 5.32/04 compilation works fine, but when exchanging root files in colaboration opening ROOT 6 root file in ROOT 5 and vice versa causes warning about StreamerInfo members being different size, so I want to upgrade to ROOT 6. How to solve those compilation errors?

Thanks Rfilip


_ROOT Version: ROOT 6.14/04
_Platform: Windows 10.0.17134.0 (all updates instaled)
_Compiler: Microsoft Visual C++ compiler 19.15.26730 in Microsoft Visual Studio Community 2017 (latest ver. 15.8.5)


1 Like
1 Like

Thanks for quick reply, sorry about posting duplicate, I didnt find the other thread (Internal compiler error is there in image) I voted on that bug report in Developer Community.

1 Like

Thank you very much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.