_ROOT Version: 6.26.10 debug
_Compiler:VC++ 2022 (Tools v143 SDK 10.0 - ISO C++20 ISO C17)
I had my c++ programme compiling with an older version of ROOT6 and with an older version of VS (2019) but now I upgraded to VS 2022 and the latest version of ROOT6 as above, I cannot get it to compile without throwing up a few errors. I tried various combinations of sdk, language versions etc, also vs release with root release and debug with debug and they all seem to throw up the same errors.
One thing that is a little confusing is that I keep reading that the root install executable must correspond to the exact version of visual studio installed, but I cannot see anywhere this exact visual studio configuration. In a number of places I read the term “latest” but this is not very specific:)
Any ideas would be welcome.
Below is the error output of visual studio (obviously the last error is unrelated to ROOT):
Hi, there is a known issue with the latest version of Visual Studio 2022 (17.4 and higher), which requires LLVM13 (we are working on the upgrade) for compatibility reasons. And note that C++20 is not yet supported (it should be with LLVM 13)
And about the different versions, it’s hard to tell. The situation improved a lot with VS2019, and in principle VS2019 and VS2022 should be compatible to some extend (they update every week or so, then it’s hard to tell)
Thank you for the prompt reply. Question is what to do now? Can I “roll back” to some version of root6/visual studio? Can I simply roll back the toolset or versions of language and SDK without uninstalling visual studio?
Can I have exact matching version of root6 and vs configuration?
ok, unfortunately I cannot roll back to an earlier version of VS2022 because microsoft won’t let me (for the community product) so I had to roll back to VS2019 Version 16.11.21. I tried compiling the same code and here is what I got:
I rolled back to VS2019 and tried what you said but was getting the same errors.
Then finally I managed to dig out some older version of the code and checked the settings to be
root_v5.34.38 release x86
This compiled just fine.
Could it be the fact that I am using ROOTCINT to generate the dictionary as opposed to CLINT?
I read that RootCint in ROOT6 is just an alias to CLINT so I assumed that it works. But one of the two errors I am getting is in the Streamer class, so could it be that I am not generating the correct dictionary?
To clarify, I am using the exact rootcint command I was using for root5 with the same linkdef file.
can I propose something? I think it would save people like me tons of time if for each version of root binaries download, if there was a full “hello world project” in visual studio, or any of the other supported platforms, with all the settings pre-set. So one could download this, load it in their favourite editor and compile it straight away. Then they can paste their code in it and get going immediately.
It is remarkable that after weeks of trials and following your advice, I got it to work in a way you didn’t think it would work, and I could not get it to work in the way you thought it would. Sure maybe I put the wrong setting somewhere but it shouldn’t need to be like that.