I think the code below should explain whats going on. I'm quite baffled by this. Any pointers or explanations on why this happens would be greatly appreciated! (Also, let me know if you aren't able to reproduce the problem... I've done this on both Windows (188) and OSX (185), using both ESP32 and ESP8266 targets. (build env's for both set up via board manager).
To set up test example, create a new sketch + one additional blank tab with .ino file.
Note that the actual OSC functionality is not in question here, but simply trying to figure out why the project fails to build under these rather bizzare circumstances of adding another function with the name "setup" inside it.
Thanks in advance!
#include <WiFiUdp.h> //test #1-4
#include <OSCMessage.h> // https://github.com/CNMAT/OSC
//test #6 - uncomment setupBarrr()
//void setupBarrr() {
//}
void setup() {
delay(10);
}
void loop() {
delay(10);
}
void fromHost(OSCMessage &msg, int addressOffset) {
}
//test #1-4 -> move this to other tab
void Foosetup() { //could be setupFoo, setupBlah, etc... same behaviour
delay(10);
}
// Test Cases:
//1. #include <WiFiUdp.h> + Foosetup in another_file.ino == fail
//2. comment out line 1: #include <WiFiUdp.h> + Foosetup in another_file.ino == fail
//3. remove line 1: #include <WiFiUdp.h> + Foosetup in another_file.ino == OK
//4. blank 1st line + Foosetup in another_file.ino == fail
//5. Foosetup in this file + any of the above == OK
//6. setupBarrr() in this file + any of the above == OK
// error message for fail cases: variable or field 'fromHost' declared void