Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to keep FS classes in namespace (#2030)
Putting `#define FS_NO_GLOBALS` before `#include <FS.h>` will disable `using` declarations for FS classes.
- Loading branch information
43fb139
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ivan, all,
I'm new here and not a good programer...
I have a stable stand-alone ESP8266 webserver prorgammed with Arduino IDE running.
The webserver serves 3 pages from the internal SPIFFS (#include "FS.h").
All fine...
But now I'm trying to add an external SD- card module.
Hardware connection should be ok, as I'm able to run single SD card test ino with succsess.
However, as soon as I try to include (#include <SD.h>) to my webserver.ino, I got the following compiler error:
Multiple libraries were found for "SD.h"
Used: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\SD
Not used: C:\Arduino\arduino-1.6.12\libraries\SD
Using library ESP8266WiFi at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi
Using library ESP8266WebServer at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WebServer
Using library Wire at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\Wire
Using library SD at version 1.0.5 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\SD
Using library SPI at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\SPI
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
I changed the FS.h according to the description above and added the define below as mentioned.
#define FS_NO_GLOBALS
before
#include <FS.h>Then I got slightly different error messages:
Multiple libraries were found for "SD.h"
Used: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\SD
Not used: C:\Arduino\arduino-1.6.12\libraries\SD
Using library ESP8266WiFi at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi
Using library ESP8266WebServer at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WebServer
Using library Wire at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\Wire
Using library SD at version 1.0.5 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\SD
Using library SPI at version 1.0 in folder: C:\Arduino\arduino-1.6.12\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\SPI
exit status 1
no match for 'operator=' (operand types are 'File' and 'fs::File')
Looks like I have to call my files on internal SPIFFS somehow different. But how???
And what about the external SD card module?
Thanks in advance,
Klaus