I am getting local and CLI compile errors which did not come up when I first compiled some code (locally) a couple of months ago. I am now getting these errors:
undefined reference to 'String::operator=(String&&)'
I can share the code (openweathermap stuff) but it has a lot of files. I just wonder if anyone has seen this and if it is a simple fix before I post the code?
Some of the operator= code in String is #ifdef out with an experimental compiler switch #ifdef __GXX_EXPERIMENTAL_CXX0X__. I have never tested what happens when you turn that switch on.
The work around is change code like this:
myString1 = myString2;
to be like this:
myString1 = "";
myString1 += myString2;
The former tries to copy a pointer while the later copies the data out of string2 into string1.
@bko, did something change with the compilers or perhaps c11 has been enabled but the code compiled just fine in the past. I have posted the files and perhaps you can get a chance to compile it as a single directory in spark CLI. The error messages don’t obviously point to the errors.
no i don’t tend to bother with the cloud stuff, didn’t notice there’s a q3 version of gcc
i suspect an upgrade will help you as the c++11 stuff it pretty bleeding edge even in x86 gcc 4.9, and takes a while to get backported to 4.8 for arm/avr.
@sej7278, with the new version of gcc and doing a clean make, it compiled fine now. It may be that the cloud still uses an older version of gcc. Thanks for the helping hand!
@zachary, @Dave, can you check to make sure the compile farm is using the latest gcc version
I think the string error undefined reference to String::operator=(String&&)' is something that’s been around for a while… I actually assigned this bug to the firmware team in December 2013… but I’ll run it by the team again and see if we can get a solution.
So you’re thinking just updating the toolchain server-side will resolve it? I’m a tiny bit cautious about deploying something only released a day or two ago, but I’ll bring it up with the team and see when we can get that out.
So something that may be an interesting lead… I went to compile this locally with make APP=weather with all of the files in the weather folder, and it was giving me the same error as the cloud. But when I switched to make clean all APP=weather it compiled just fine.
This has come up before if I remember correctly. Is there a way to force make clean all on the cloud @Dave ?