Skip to content

Conversation

@per1234
Copy link
Contributor

@per1234 per1234 commented Jul 1, 2021

The placement of the tests program in the root of the library caused it to be compiled by the Arduino build system, which
causes serious problems:

  • Compilation fails for boards whose toolchain doesn't provide iostream ("iostream: No such file or directory")
  • When compilation doesn't fail, the test main() overrides the Arduino core library's main(), completely nuking the user's sketch. On MCUs with native USB (e.g., ATSAMD21G18), this includes the USB CDC code that provides a serial port for uploads on native USB MCUs (e.g., ATSAMD21G18), soft bricking the board.

The new location for the file is fairly standardized. For example:
https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/extras/test
The extras folder is intended to be a place to put things that should be ignored by the Arduino development software and build system:
https://arduino.github.io/arduino-cli/latest/library-specification/#extra-documentation

The placement of the tests program in the root of the library caused it to be compiled by the Arduino build system, which
causes serious problems:

- Compilation fails for boards whose toolchain doesn't provide iostream
- When compilation doesn't fail, the test `main()` overrides the Arduino core library's `main()`, completely nuking the
  user's sketch, including the USB CDC code that provides a serial port for uploads on native USB MCUs (e.g., ATSAMD21G18),
  soft bricking the board.
@sobrinho
Copy link

@ivanseidel ping!

@lucameier
Copy link

hi @ivanseidel
i could not compile my sketch without an error. this would have fixed it.
please merge.
see https://forum.arduino.cc/t/compilererror-undefined-reference-samd51/967414/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No output to Serial Output iostream compilation error on Arduino Mega Compile error for Arduino Nano

4 participants