I am starting to learn / program the Arduino and I don't understand why I am getting syntax errors upon compiling my program in Visual Studio 2017 with Visual Micro or with the Arduino IDE.
Compiling output error from Visual Studio 2017:
sketch\SketchIncomeEligible.ino.cpp.o:(.text.setup+0x0): undefined reference to `WiFi_Setup()'
sketch\SketchIncomeEligible.ino.cpp.o: In function `setup':
ible\SketchIncomeEligible/SketchIncomeEligible.ino:6: undefined reference to `WiFi_Setup()'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.
Compiling error from Arduino IDE:
Arduino: 1.8.9 (Windows 10), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
sketch\SketchIncomeEligible.ino.cpp.o:(.text.setup+0x0): undefined reference to `WiFi_Setup()'
sketch\SketchIncomeEligible.ino.cpp.o: In function `setup':
ible\SketchIncomeEligible/SketchIncomeEligible.ino:6: undefined reference to `WiFi_Setup()'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The following is my code:
SketchWiFi.h file: #ifndef _SKETCHWIFI_h
#define _SKETCHWIFI_h
int WiFi_Setup();
#endif
SketchWiFi.c file: #include "SketchWiFi.h"
int WiFi_Setup()
{
// put your setup code here, to run once:
return 1; // Successful
}
Sketch.ino file: #include "SketchWiFi.h"
void setup() {
Serial.begin(115200);
Serial.println("Begin setup");
WiFi_Setup();
Serial.println("End setup");
}
void loop() {
// put your main code here, to run repeatedly:
}