VS Errors when creating custom class dictionaries

Hi there

I am experiencing some issues generating dictionaries for an old custom class of mine. The class was originally written and and successfully used in ROOT 5.34 but now I’ve finally upgraded to ROOT 6.24/00 and I’m trying to port the class.

I think I have implemented all the edits required for depreciated code and replacement nomenclature. When I try to create the required dictionaries used the rootcling route I see a whole bunch of errors which look like they point to either a VS or Windows error, perhaps something with the install? Version 6.24/00 was installing on my Windows 10 machine, with the compatible Visual Studio 2022. Any light that can be shed on the problem much appreciated! I think I’m using all of the correct versions etc. to use on Windows.

Here are the errors:

C:\Users\duncan.m.horne\source\repos\ROOT_GammaLib\ROOT_GammaLib>rootcling -f GammaSpecDict.cxx -c GammaSpec.h LinkDef.h
In file included from input_line_3:2:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\string:11:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\xstring:14:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\xmemory:16:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\xutility:15:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\utility:131:9: error: expected member name or ‘;’ after declaration specifiers
!conjunction_v<_Is_implicitly_default_constructible<_Uty1>, _Is_implicitly_default_constructible<_Uty2>>)
^
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\utility:131:9: error: expected ‘)’
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\utility:130:23: note: to match this ‘(’
constexpr explicit(
^
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\utility:217:24: error: expected member name or ‘;’ after declaration specifiers
constexpr explicit(!conjunction_v<is_convertible<const _Other1&, _Ty1>, is_convertible<const _Other2&, _Ty2>>)
~~~~~~~~~~~~~~~~~~ ^
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\utility:217:24: error: expected ‘)’
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103\include\utility:217:23: note: to match this ‘(’
constexpr explicit(!conjunction_v<is_convertible<const _Other1&, _Ty1>, is_convertible<const _Other2&, _Ty2>>)
^
In file included from input_line_4:2:
In file included from C:/root_v6.24.00/include\Rtypes.h:23:
C:/root_v6.24.00/include/RtypesCore.h:91:17: error: redefinition of ‘kTRUE’
const Bool_t kTRUE = true;
^
note: ‘C:/root_v6.24.00/include/RtypesCore.h’ included multiple times, additional include site here
fatal error: cannot open file ‘input_line_3’: no such file or directory
C:/root_v6.24.00/include\Rtypes.h:23:10: note: ‘C:/root_v6.24.00/include/RtypesCore.h’ included multiple times, additional include site here
#include “RtypesCore.h”
^
C:/root_v6.24.00/include/RtypesCore.h:91:17: note: unguarded header; consider using #ifdef guards or #pragma once
const Bool_t kTRUE = true;
^
Error: Error loading the default rootcling header files.

_ROOT Version: 6.24/00
_Platform: Windows 10
_Compiler: VS2022


Welcome to the ROOT Forum!
Which exact version of Visual Studio do you have? This might be due to an incompatibility between Visual Studio v17.4 and LLVM 9.0. To solve this, you have to either build the master branch (from github, see Building ROOT from source - ROOT ) or wait for ROOT v6.28/00, which will come very soon (probably this week). And note you can also take a pre-built binary

I’m using VS2022 v17.1.3.

Alas due to security constraints I’m unable to build ROOT from source so I’m required to use the prebuilt binaries. Does the version number I’m using alter your suggestion or should I wait for v6.28/00?

Will this new version be compatible with my version of VS on Windows 10? (I am also out of control to change either of these versions)

OK, so I think v17.1.3 should work with any recent version of ROOT. You could try the version 6.26/10.(it’s hard to verify all versions of ROOT vs all versions of Visual Studio).

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