# Missing std::string::operator=(std::string&&)

**URL:** <https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036>\
**Category:** Cling\
**Created:** [October 19, 2015, 9:39am UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036 "2015-10-19T09:39:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrase](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@andrase](https://root-forum.cern.ch/u/andrase)\
**Post date:** [October 19, 2015, 9:39am UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/1 "2015-10-19T09:39:01Z")

</div>

When I try to compile

“#include \n”  
"#include \<stdio.h\>\n"  
“std::string& test(std::string& s) {\n”  
“s = s + s;\n”  
//“std::string ss = s + s;\n”  
//“s = ss;\n”  
“return s;\n”  
"}";

I end up with “IncrementalExecutor: calling unresolved symbol, see previous error message!”, with no previous error message. A little digging around revealed that the unresolved symbol is “\_ZNSsaSEOSs”, IOW ‘std::string::operator=(std::string&&)’ – the commented out variant above compiles and works fine. What can be the reason for the missing symbol? (I am on redhat, gcc 4.8.2 if that’s relevant.)

Thanks,  
Andras

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [October 19, 2015, 11:37pm UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/2 "2015-10-19T23:37:26Z")

</div>

Hi,

Is this using devtoolset?

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![andrase](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@andrase](https://root-forum.cern.ch/u/andrase)\
**Post date:** [October 20, 2015, 8:15am UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/3 "2015-10-20T08:15:57Z")

</div>

Yes (rhdevtoolset, but not [linux.web.cern.ch/linux/devtoolset/](http://linux.web.cern.ch/linux/devtoolset/) if that is in any way different).

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [October 20, 2015, 7:02pm UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/4 "2015-10-20T19:02:58Z")

</div>

Hi,

We don’t support the compiler that’s part of devtoolset (rh\* is just a different name for it). The reason is here: [sft.its.cern.ch/jira/browse/ROOT-6207](https://sft.its.cern.ch/jira/browse/ROOT-6207)

That said: I just talked to one of the core GCC devs and we might have come up with a solution. It won’t be implemented immediately but at least we have an idea how to solve it.

For now, please build the compiler yourself or try to use the one e.g. from epel.

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![andrase](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@andrase](https://root-forum.cern.ch/u/andrase)\
**Post date:** [October 21, 2015, 8:26am UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/5 "2015-10-21T08:26:50Z")

</div>

Unfortunately this is a corp/prod environment and i have no choice in which compiler to use (and not allowed to install my own). Do you know which other symbols are affected by this problem? (Is it limited to std::string/move ctors?)

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [October 21, 2015, 9:18am UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/6 "2015-10-21T09:18:49Z")

</div>

Hi,

All symbols not part of the native compiler’s libstdc++.

As I said - I’ll look into that, it will take a few weeks (not because of this but because of other things that keep me busy).

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![pnip](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@pnip](https://root-forum.cern.ch/u/pnip)\
**Post date:** [August 16, 2018, 9:14pm UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/7 "2018-08-16T21:14:01Z")

</div>

Ran into the same issue? following up to see if there is any more update?

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [August 22, 2018, 10:28am UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/8 "2018-08-22T10:28:53Z")

</div>

I still did not get around to implementing this. Anyone reading this and willing to come up with a pull request for it is very welcome to ping me (also privately) to get some hints on what needs to be done.

Until then: no devtoolset, please.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [August 22, 2018, 9:49pm UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/9 "2018-08-22T21:49:40Z")

</div>

Please try with at least GCC 4.8.5, this is the oldest version that we support. I believe C++11 support is not complete in older versions of GCC.

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [August 22, 2018, 11:11pm UTC](https://root-forum.cern.ch/t/missing-std-string-operator-std-string/20036/10 "2018-08-22T23:11:34Z")

</div>

4.8.1 is feature complete for C++11; 4.8.5 was the last patch release in the 4.8 series, which is why it is a more common choice (e.g. for conda). It’s relevant for me as manylinux1 wheels have 4.8.2 and that works fine for at least the minimal subset of Cling/ROOT that I use in cppyy.

Certainly, the use of string&& which seems to have started this thread is not an issue:

```auto
>>> import cppyy
>>> a = cppyy.gbl.string("a")
>>> a. __assign__. __overload__ ("string&&")(cppyy.gbl.std.string("b"))
'b'
>>>

```
