Hello all!! Was hoping someone could help me see here… In the following basic structure, I get multiple definitions of ‘server’ errors when compiling but I can’t see why, maybe someone could school me please?
No. You can’t create and share a global variable this way when a header is included by multiple .cpp files. The header needs to have extern ESP8266WebServer server; here as declaration-only instead of the variable creation and you must create a .cpp file (say e.g., global_vars.cpp in which you #include <PreProcessorDefs.h> ESP8266WebServer server(80); to define the variable.