# Std::map error

**URL:** <https://root-forum.cern.ch/t/std-map-error/52785>\
**Category:** Newbie\
**Created:** [December 15, 2022, 10:19pm UTC](https://root-forum.cern.ch/t/std-map-error/52785 "2022-12-15T22:19:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shu11](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shu11](https://root-forum.cern.ch/u/shu11)\
**Post date:** [December 15, 2022, 10:19pm UTC](https://root-forum.cern.ch/t/std-map-error/52785/1 "2022-12-15T22:19:00Z")

</div>

Hi,

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [December 16, 2022, 7:37am UTC](https://root-forum.cern.ch/t/std-map-error/52785/2 "2022-12-16T07:37:28Z")

</div>

> [@shu11](#):
>
> What’s wrong with this code?

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

---

<div class="post-metadata">

**Author:** ![shu11](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shu11](https://root-forum.cern.ch/u/shu11)\
**Post date:** [December 16, 2022, 4:17pm UTC](https://root-forum.cern.ch/t/std-map-error/52785/3 "2022-12-16T16:17:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 16, 2022, 5:04pm UTC](https://root-forum.cern.ch/t/std-map-error/52785/4 "2022-12-16T17:04:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shu11](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shu11](https://root-forum.cern.ch/u/shu11)\
**Post date:** [December 16, 2022, 11:42pm UTC](https://root-forum.cern.ch/t/std-map-error/52785/5 "2022-12-16T23:42:54Z")

</div>

This is a binary build.

* * *

| Welcome to ROOT 6.27/01 [https://root.cern](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’ |
| --- |

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 17, 2022, 9:10am UTC](https://root-forum.cern.ch/t/std-map-error/52785/6 "2022-12-17T09:10:42Z")

</div>

@shu11 Try to take the latest [pre-built nightly binary](https://root.cern/download/nightly/?C=M;O=D).

@bellenot Looks like a Windows problem.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 17, 2022, 10:43am UTC](https://root-forum.cern.ch/t/std-map-error/52785/7 "2022-12-17T10:43:54Z")

</div>

@shu11 it works for me:

```auto
**********************************************************************
** 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?

---

<div class="post-metadata">

**Author:** ![shu11](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shu11](https://root-forum.cern.ch/u/shu11)\
**Post date:** [December 17, 2022, 1:19pm UTC](https://root-forum.cern.ch/t/std-map-error/52785/8 "2022-12-17T13:19:35Z")

</div>

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’
