I'm working on a code for a friend. I'm using a Mega en he is using a Due.
The below code is the minimum example that throws an error on the Due but no error on the Mega.
uint16_t index;
void setup()
{
// put your setup code here, to run once:
}
void loop()
{
// put your main code here, to run repeatedly:
}
The error
sketch_jan03a:1: error: 'uint16_t index' redeclared as different kind of symbol
uint16_t index;
^
In file included from c:\users\sterretje\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\stdlib.h:11:0,
from C:\Users\sterretje\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:24,
from sketch\sketch_jan03a.ino.cpp:1:
c:\users\sterretje\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\string.h:55:8: error: previous declaration of 'char* index(const char*, int)'
char *_EXFUN(index,(const char *, int));
^
Some research shows that this problem is not limited to the Due; see e.g. Getting error message 'DS3231 clock' redeclared as different kind of symbol' where (part of) the error for a NodeMcu is
C:\Users\seamr\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/libc/xtensa-lx106-elf/include/../include/time.h:50:19: error: previous declaration of 'clock_t clock()'
clock_t _EXFUN(clock, (void));
So certain 'names' (index, clock) seem to cause a conflict and the big question is what those 'names' are. Anyway to find it?