Skip to content

#include <algorithm> causes a compilation error when compiling for Arduino Due and SAMD #308

Open
@VioletGiraffe

Description

@VioletGiraffe

When compiled for Due, this sketch

#include <algorithm>

void setup() {}
void loop() {}

produces this error:

arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\cstdio:122:11: error: '::printf' has not been declared

It means that sketches targeting Due simply cannot use <algorithm>, which is not cool.

Commenting out the line #undef printf in the cstdio header solves the problem. Hopefully, this will get fixed and we won't have to patch the system headers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions