arduino / arduino/ArduinoCore-sam
Compile error with #include <unistd.h>
- Dominant language
- HTML
- Stars
- 91
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
IDE: Arduino 1.8.7 on Windows.
Core version: Arduino SAM Boards 1.6.11, installed from Boards Manager
MCVE sketch:
```
#include
void setup() {
}
void loop() {
}
```
Error message:
```
Arduino: 1.8.7 (Windows Store 1.8.15.0) (Windows 10), Board: "Arduino Due (Programming Port)"
In file included from c:\users\sunny\documents\arduinodata\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\stdlib.h:11:0,
from C:\Users\sunny\Documents\ArduinoData\packages\arduino\hardware\sam\1.6.11\cores\arduino/Arduino.h:24,
from sketch\sketch_nov18a.ino.cpp:1:
c:\users\sunny\documents\arduinodata\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\sys\unistd.h:118:9: error: declaration of C function 'int link(const char*, const char*)' conflicts with
int _EXFUN(link, (const char *__path1, const char *__path2 ));
^
In file included from C:\Users\sunny\Documents\ArduinoData\packages\arduino\hardware\sam\1.6.11\variants\arduino_due_x/variant.h:50:0,
from C:\Users\sunny\Documents\ArduinoData\packages\arduino\hardware\sam\1.6.11\cores\arduino/Arduino.h:201,
from sketch\sketch_nov18a.ino.cpp:1:
C:\Users\sunny\Documents\ArduinoData\packages\arduino\hardware\sam\1.6.11\cores\arduino/syscalls.h:43:12: error: previous declaration 'int link(char*, char*)' here
extern int link( char *cOld, char *cNew ) ;
^
exit status 1
Error compiling for board Arduino Due (Programming Port).
```
The header `unistd.h` is used by [ArduinoCbor](https://github.com/bergos/ArduinoCbor/) library in [cn-cbor.h](https://github.com/bergos/ArduinoCbor/blob/c142cb0cd650e07ef069448b09c27c994c346381/src/cn-cbor/cn-cbor.h#L19).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with cores/arduino/syscalls.h and variants/arduino_due_x/variant.h, then inspect the unistd.h inclusion from ArduinoCbor's src/cn-cbor/cn-cbor.h. Reproduce the MCVE on an Arduino Due with Arduino SAM Boards 1.6.11 and confirm that the include no longer produces conflicting link declarations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100