Skip to content

Compiling error #1

Description

@mphiruhr

Hi, I had a compiling error with the Arduino IDE.

In file included from /private/var/folders/jk/m7dqctr53_96w0zhnk1s479r0000gn/T/.arduinoIDE-unsaved2026330-8527-1njbomx.w9y7/sketch_apr30a/sketch_apr30a.ino:15:

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/WebServer/src/WebServer.h:222:32: error: 'FS' was not declared in this scope; did you mean 'fs::FS'?

  222 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;

      |                                ^~

      |                                fs::FS

In file included from /Users/philip/Documents/Arduino/libraries/TFT_eSPI/Processors/TFT_eSPI_ESP32.h:138,

                 from /Users/philip/Documents/Arduino/libraries/TFT_eSPI/TFT_eSPI.h:101,

                 from /private/var/folders/jk/m7dqctr53_96w0zhnk1s479r0000gn/T/.arduinoIDE-unsaved2026330-8527-1njbomx.w9y7/sketch_apr30a/sketch_apr30a.ino:12:

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/FS/src/FS.h:87:7: note: 'fs::FS' declared here

   87 | class FS {

      |       ^~

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/WebServer/src/WebServer.h:222:32: error: 'FS' was not declared in this scope; did you mean 'fs::FS'?

  222 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;

      |                                ^~

      |                                fs::FS

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/FS/src/FS.h:87:7: note: 'fs::FS' declared here

   87 | class FS {

      |       ^~

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/WebServer/src/WebServer.h:222:60: error: template argument 1 is invalid

  222 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;

      |                                                            ^

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/WebServer/src/WebServer.h:222:16: error: '<expression error>' in namespace 'std' does not name a type

  222 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;

      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/WebServer/src/WebServer.h:223:32: error: 'ETagFunction' has not been declared

  223 |   void enableETag(bool enable, ETagFunction fn = nullptr);

      |                                ^~~~~~~~~~~~

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/WebServer/src/WebServer.h:240:3: error: 'ETagFunction' does not name a type; did you mean 'TaskFunction_t'?

  240 |   ETagFunction _eTagFunction = nullptr;

      |   ^~~~~~~~~~~~

      |   TaskFunction_t

/Users/philip/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/WebServer/src/WebServer.h:223:50: error: could not convert 'nullptr' from 'std::nullptr_t' to 'int'

  223 |   void enableETag(bool enable, ETagFunction fn = nullptr);

      |                                                  ^~~~~~~

      |                                                  |

      |                                                  std::nullptr_t

exit status 1

Compilation error: exit status 1"

What fixed it was adding "#include <FS.h>
using fs::FS;" above all else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions