arduino / arduino/ArduinoCore-sam

<iostream> not usable

Open
#144 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
91
Forks
112
PR merge metrics
No merged PRs in 30d

Description

The inclusion of some standard library headers can cause compilation errors. For example:
```C++
#include
void setup() {
}
void loop() {
}
```
```
C:\Users\vhtmf\AppData\Local\Temp\arduino\sketches\4F283322D1DC7D231547A617FD5B3E64\sketch\sketch_feb10a.ino.cpp.o: In function `__static_initialization_and_destruction_0':
c:\users\vhtmf\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3/iostream:74: undefined reference to `std::ios_base::Init::Init()'
c:\users\vhtmf\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1
```
It seems that there are some functions declared in the header file that are not defined.

The standard library does not appear to be in this repository. Does anyone know where it's downloaded from? I installed the standard library automatically after installing the Arduino SAM Boards in the Arduino IDE Board Manager.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the minimal sketch containing #include with the Arduino SAM Boards toolchain and inspect the reported linker failure. Read the Arduino SAM build configuration and the arm-none-eabi C++ standard-library setup; done means the sketch compiles and links without the undefined std::ios_base::Init symbols.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.