Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Error when using auto (Read 2734 times)
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Error when using auto
Oct 14th, 2019 at 11:28am
Print Post  
Hi
I am using a library found here https://github.com/szotsaki/TinyGSM It makes use of the keyword auto and I get this error when compiling code for a SAMD21 / Arduino Zero.

Code (C++)
Select All
Compiling 'Outpost' for 'Arduino/Genuino Zero (Native USB Port)'
Build Folder: Release"
Summary: Header=1 Prototypes=21 Imports=16
Additional Defines:
Architecture Tools: eabi-gcc/7-2017q4/bin/"
Api: 1908070
Sketch Book: "file:///C:/Arduino_Workspace/arduino"
Sketch Include Paths
Core Include Paths
Include Path .8.3/cores/arduino"
Include Path .8.3/variants/arduino_zero"
Library Include Paths (8)
Include Path 'C:\Arduino_Workspace\arduino\libraries\ArduinoJson\src'
Include Path raries\SPI'
Include Path 'C:\Arduino_Workspace\arduino\libraries\SD\src'
Include Path 'C:\Arduino_Workspace\arduino\libraries\RTCZero\src'
Include Path 'C:\Arduino_Workspace\arduino\libraries\Timer'
Include Path 'C:\Arduino_Workspace\arduino\libraries\StreamDebugger'
Include Path 'C:\Arduino_Workspace\arduino\Outpost\Libraries\TinyGSM\src'
Include Path 'C:\Arduino_Workspace\arduino\libraries\Arduino_Low_Power\src'

Building variant ...

  Using previously compiled variant

Building core ...

Building libraries ...

Using library ArduinoJson version 6.11.1 in folder "file:///C:/Arduino_Workspace/arduino/libraries/ArduinoJson"

Using library SPI version 1.0 in folder .8.3/libraries/SPI"
  Using previously compiled file: PI\SPI.cpp.o

Using library SD version 1.2.3 in folder "file:///C:/Arduino_Workspace/arduino/libraries/SD"
  Using previously compiled file: D\File.cpp.o
  Using previously compiled file: D\SD.cpp.o
  Using previously compiled file: D\utility\Sd2Card.cpp.o
  Using previously compiled file: D\utility\SdFile.cpp.o
  Using previously compiled file: D\utility\SdVolume.cpp.o

Using library RTCZero version 1.6.0 in folder "file:///C:/Arduino_Workspace/arduino/libraries/RTCZero"
  Using previously compiled file: TCZero\RTCZero.cpp.o

Using library Timer version 0.0.0 in folder "file:///C:/Arduino_Workspace/arduino/libraries/Timer"
  Using previously compiled file: imer\Event.cpp.o
  Using previously compiled file: imer\Timer.cpp.o

Using library StreamDebugger version 1.0.1 in folder "file:///C:/Arduino_Workspace/arduino/libraries/StreamDebugger"

Using library TinyGSM version 0.3.5 in folder "file:///C:/Arduino_Workspace/arduino/Outpost/Libraries/TinyGSM"

Using library Arduino_Low_Power version 1.2.1 in folder "file:///C:/Arduino_Workspace/arduino/libraries/Arduino_Low_Power"
  Using previously compiled file: rduino_Low_Power\nrf52\ArduinoLowPower.cpp.o
  Using previously compiled file: rduino_Low_Power\samd\ArduinoLowPower.cpp.o

Building project code ...
\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=10809 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON -DUSB_MANUFACTURER="\"Arduino LLC\"" -DUSB_PRODUCT="\"Arduino Zero\"" IS/Include/" .0/CMSIS/Device/ATMEL/" -I"C:\Arduino_Workspace\arduino\Outpost" -I"C:\Arduino_Workspace\arduino\libraries\ArduinoJson\src" ibraries\SPI" -I"C:\Arduino_Workspace\arduino\libraries\SD\src" -I"C:\Arduino_Workspace\arduino\libraries\RTCZero\src" -I"C:\Arduino_Workspace\arduino\libraries\Timer" -I"C:\Arduino_Workspace\arduino\libraries\StreamDebugger" -I"C:\Arduino_Workspace\arduino\Outpost\Libraries\TinyGSM\src" -I"C:\Arduino_Workspace\arduino\libraries\Arduino_Low_Power\src" ores\arduino" ariants\arduino_zero" Outpost.cpp" -o Outpost.cpp.o"

TinyGsmClientSIM808.h:12: In file included from
Outpost.ino:20: from
TinyGsmClientSIM800.h: In member function bool TinyGsmSim800::setPreferredMessageStorage(const MessageStorageType*)

TinyGsmClientSIM800.h: 954:75: error: invalid use of 'auto
   const auto convertMstToString = [](const MessageStorageType &type) -> auto {
   ^~~~

Outpost.ino:17: In file included from
TinyGsmClientSIM800.h: In lambda function

TinyGsmClientSIM800.h: 957:19: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   return GF("\"SM\"")
TinyGsmCommon.h:48: note  in definition of macro GF
   #define GF(x)  x

TinyGsmClientSIM800.h: 959:19: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   return GF("\"ME\"")
TinyGsmCommon.h:48: note  in definition of macro GF
   #define GF(x)  x

TinyGsmClientSIM800.h: 961:19: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   return GF("\"SM_P\"")
TinyGsmCommon.h:48: note  in definition of macro GF
   #define GF(x)  x

TinyGsmClientSIM800.h: 963:19: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   return GF("\"ME_P\"")
TinyGsmCommon.h:48: note  in definition of macro GF
   #define GF(x)  x

TinyGsmClientSIM800.h: 965:19: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   return GF("\"MT\"")
TinyGsmCommon.h:48: note  in definition of macro GF
   #define GF(x)  x

TinyGsmClientSIM800.h: 968:17: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   return GF("")
TinyGsmCommon.h:48: note  in definition of macro GF
   #define GF(x)  x
Error compiling project sources
Build failed for project 'Outpost'

 



  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error when using auto
Reply #1 - Oct 14th, 2019 at 12:06pm
Print Post  
Does it build okay in the arduino ide?
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Error when using auto
Reply #2 - Oct 14th, 2019 at 12:48pm
Print Post  
Hi Tim
No it does not. I get the same error.
  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Error when using auto
Reply #3 - Oct 14th, 2019 at 1:09pm
Print Post  
Tim
It seems to have something to do with gnu++11 that must change to gnu++14. Not sure where to do the change
  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Error when using auto
Reply #4 - Oct 14th, 2019 at 1:16pm
Print Post  
Tim
Seems to be the gnu++14. To fix it do the following:

C++14 compatibility is required: replace gnu++11 to gnu++14 in your <Arduino IDE directory>/hardware/arduino/avr/platform.txt.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error when using auto
Reply #5 - Oct 14th, 2019 at 1:18pm
Print Post  
okay the info requested in the yellow box above will show us tool chain versions. If the lib is written for the zero I guess there will be an updated board manager toolchain. Otherwise you can try adding an F4 project properties extra cpp flag with the compiler setting you want to try or better still change the platform.txt. I suspect it is not as easy as just changing the compiler flag and that you need a tool chain and core that are written to the correct spec. the lib requires.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error when using auto
Reply #6 - Oct 14th, 2019 at 1:20pm
Print Post  
I posted last before your last post.

The comment you posted relates to avr boards but you re using SAMD. I suspect the lib is not written with the Arduino Zero in mind.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error when using auto
Reply #7 - Oct 14th, 2019 at 1:22pm
Print Post  
ps: your samd platform.txt is here

C:\Users\mariu\AppData\Local\arduino15\packages\arduino\hardware\samd\1.8.3
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Error when using auto
Reply #8 - Oct 14th, 2019 at 1:41pm
Print Post  
Tim
I also added -std=gnu++14 to the extra cpp flags. Dont know if that was the one that worked.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint