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

can't compile with platformio. #11

Open laxtiz opened 2 years ago

laxtiz commented 2 years ago

Describe the bug 我不太懂C++,我只想了解这是什么问题。 i don't know more with c++. i can't compile with this library.

To Reproduce Steps to reproduce the behavior: code with PlatformIO IDE, but compile faild when linechart library installed.

Expected behavior A clear and concise description of what you expected to happen. no more error.

Screenshots If applicable, add screenshots to help explain your problem.

2022-05-06 13-55-17 的屏幕截图

Desktop (please complete the following information):

Additional context here is platform package version:

2022-05-06 14-11-13 的屏幕截图

here is my platformio config:

[env]
framework = arduino
monitor_filters = direct
monitor_speed = 115200

[env:seeed_wio_terminal]
platform = atmelsam
board = seeed_wio_terminal
build_flags = 
    ; too more redefined macros warning. disable all.
    -w
lib_deps = 
    Wire
    SPI
    seeed-studio/Seeed Arduino FS@^2.1.1
    seeed-studio/Seeed Arduino SFUD@^2.0.2
    seeed-studio/Seeed_Arduino_mbedtls@^3.0.1
    seeed-studio/Seeed Arduino rpcUnified@^2.1.4
    seeed-studio/Seeed Arduino rpcWiFi@^1.0.5
    seeed-studio/Seeed Arduino rpcBLE@^1.0.0
    seeed-studio/Seeed Arduino IR@^1.0.2
    seeed-studio/Grove-3-Axis-Digital-Accelerometer-2g-to-16g-LIS3DHTR@^1.2.4
    ; not in platformio registry, clone repo with git.
    https://github.com/Seeed-Studio/Seeed_Arduino_Linechart
    https://github.com/Seeed-Studio/Seeed_Arduino_Histogram
    seeed-studio/Seeed Arduino RTC@^2.0.0
lakshanthad commented 2 years ago

Hello,

Does it compile successfully when linechart library is not included?

laxtiz commented 2 years ago

yes, i can compile without linechart. here you can see i added more library from seeed, but just compile failed with linechart

lakshanthad commented 2 years ago

Can you attach a complete log of the output to check for all the errors?

laxtiz commented 2 years ago

here is a demo repo, just only linechart library.

platformio config:


[env:seeed_wio_terminal]
platform = atmelsam
board = seeed_wio_terminal
framework = arduino
lib_deps = 
        ; internal library
    Wire
    SPI
    Seeed_Arduino_LCD
    ; clone from github
    https://github.com/Seeed-Studio/Seeed_Arduino_Linechart
    ; linechart need this
    adafruit/Adafruit Zero DMA Library@^1.1.0

here is log: log.txt

lakshanthad commented 2 years ago

Hello,

According to your error messages, it seems that "-std=gnu++14" should be set according to ArduinoCore-samd: https://github.com/Seeed-Studio/ArduinoCore-samd/blob/28c4ac5980a0393f7417c773c5d8fa4f5283b379/platform.txt#L42

From platformIO config, it seems that it is set to "-std=gnu++11" and it should be changed to "-std=gnu++14": https://github.com/platformio/platform-atmelsam/blob/67f42c69ad65f4ddbf3abfcff130bc0c9965d41d/builder/frameworks/arduino/arduino-common.py#L66

Could you maybe locally change this "platform-atmelsam/builder/frameworks/arduino/arduino-common.py" file and have a try again?

Thank you

lakshanthad commented 2 years ago

Hello @laxtiz ,

I have tested linechart with platformio and it works. Please add the following to platformio.ini:

build_unflags = -std=gnu++11

build_flags = -std=gnu++14