Std::map error

Hi,

What’s wrong with this code? ROOT version is 6.27:

std::map<std::string, int> m{{"CPU", 10}, {"GPU", 15}}
IncrementalExecutor::executeFunction: symbol '??$min@_K@std@@YAAEB_KAEB_K0@Z' unresolved while linking function '_GLOBAL__sub_I_cling_module_24'!
You are probably missing the definition of unsigned __int64 const & __ptr64 __cdecl std::min<unsigned __int64>(unsigned __int64 const & __ptr64,unsigned __int64 const & __ptr64)

Maybe you need to load the corresponding shared library?

ROOT exited after this error.

Which code? can you provide a minimal macro producing these error messages?

I think I already provided the std::map initialization line that had error in the interactive shell, shown above. You mean run it a macro would make a difference?

Which operating system and compiler versions?
How have you installed ROOT?

This is a binary build.


| Welcome to ROOT 6.27/01 https://root.cern |
| (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for win64 on Dec 01 2022, 03:49:00 |
| From remotes/origin/master@v6-25-02-2898-g8f72f53fbf |
| With MSVC 19.32.31332.0 |

Try ‘.help’/‘.?’, ‘.demo’, ‘.license’, ‘.credits’, ‘.quit’/‘.q’

@shu11 Try to take the latest pre-built nightly binary .

@bellenot Looks like a Windows problem.

@shu11 it works for me:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.19
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Users\bellenot\Downloads>root\bin\thisroot.bat

C:\Users\bellenot\Downloads>root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.27/01                        https://root.cern |
  | (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win64 on Dec 16 2022, 03:51:00                         |
  | From remotes/origin/master@v6-25-02-3306-gc75862ecee             |
  | With MSVC 19.32.31332.0                                          |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

root [0] std::map<std::string, int> m{{"CPU", 10}, {"GPU", 15}}
(std::map<std::string, int> &) { "CPU" => 10, "GPU" => 15 }
root [1]

Can you tell which version of Visual Studio you have on your computer?

I see my problem from your run: I didn’t run the thisroot.bat. That’s why I got those errors. After I ran thisroot.bat, the errors are gone.

By the way, I am using this VS:


** Visual Studio 2019 Developer Command Prompt v16.11.3
** Copyright (c) 2021 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: ‘x64’