Building dynamic lib with ROOT dependencies is failed in VS2022

Hi,

I want to build one dynamic lib with ROOT dependencies in VS2022. However it’s failed. If I used the same code to build EXE file, it’s ok.
The output is following:


And the configuration is following:

The ROOT version is 6.28. How can I fix it?
Thanks!
_
_ROOT Version:6.28
_Platform:vs2022
Compiler: Not Provided


The first message I see is the C++ standard not being the same than the one ROOT was build for (c++17). Make sure you are also using the /Zc:__cplusplus compiler flag. And generally speaking, I would advise to use CMake to generate your solution to ensure the flags are correct. And it also allows to properly export the symbols from the DLL