Seeed-Studio / Seeed_Arduino_Linechart

This library is a very lightweight library which can help you with the linechart graph you need.
MIT License
6 stars 7 forks source link

compiling for wio_terminal has compile errors #8

Closed neilh10 closed 2 years ago

neilh10 commented 3 years ago

When compiling supplied example basic.ino for wio_terminal with Platformio SAMD51 has errors.

In file included from lib\Seeed_Arduino_Linechart/seeed_line_chart.h:2:0, from D:/usr/a/PlatformIO/Projects/wioT_linechart/src/basic.ino:1: lib\Seeed_Arduino_Linechart/seeed_graphics_base.h: At global scope: lib\Seeed_Arduino_Linechart/seeed_graphics_base.h:25:23: error: 'value' function uses 'auto' type specifier without trailing return type auto & name(type value) { \ ^ lib\Seeed_Arduino_Linechart/seeed_graphics_base.h:121:9: note: in expansion of macro 'xvprop' xvprop(point, value, (return_type )); ^~ lib\Seeed_Arduino_Linechart/seeed_graphics_base.h:25:23: note: deduced return type only available with -std=c++14 or -std=gnu++14 auto & name(type value) { \ ^ lib\Seeed_Arduino_Linechart/seeed_graphics_base.h:121:9: note: in expansion of macro 'xvprop' xvprop(point, value, (return_type ));

To Reproduce Very reproducible, and many other errors.

Processing seeed_wio_terminal (platform: atmelsam; board: seeed_wio_terminal; framework: arduino)

CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/seeed_wio_terminal.html PLATFORM: Atmel SAM (6.3.1) > Seeeduino Wio Terminal HARDWARE: SAMD51P19A 120MHz, 192KB RAM, 496KB Flash DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink) PACKAGES:

Expected behavior Expect it to compile with no errors when using supplied example Basic.ino A clear and concise description of what you expected to happen.

Desktop (please complete the following information): Windows 10

RocketManRC commented 2 years ago

I discovered the solution here which for some reason is not easy to find: https://forum.seeedstudio.com/t/linechart-library-for-wio-terminal-on-platformio-ide-needs-build-flags-std-gnu-14/258456.

Add the following lines to PlatformIO.ini:

build_unflags = -std=gnu++11 build_flags = -std=gnu++14

neilh10 commented 2 years ago

Hey thanks.

neilh10 commented 2 years ago

works for me