Skip to content

Compilation error due to namespace FS in FS.h #7410

Closed
@ESPboy-edu

Description

@ESPboy-edu

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [WeMos D1 mini]
  • Core Version: [2.7.1]
  • Development Env: [Arduino IDE]
  • Operating System: [MacOS]

Settings in IDE

  • Module: [Wemos D1 mini r2]
  • Flash Mode: [dio]
  • Flash Size: [4MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [ck]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [160MHz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200] (serial upload only)

Problem Description

In some users, the compilation of https://github.com/ESPboy-edu/ESPboy_OTA causes an error
(different operating systems like windows 10, mac osx, ubuntu)

error messages
In file included from C:\Users\cheungbx\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:30:0,
                 from C:\Users\cheungbx\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecure.h:41,
                 from C:\Users\cheungbx\Documents\Arduino\libraries\HTTPSRedirect/HTTPSRedirect.h:10,
                 from C:\Users\cheungbx\Documents\Arduino\libraries\ESPboy_Arduboy2_lib-master/ESPboyOTA.h:15,
                 from C:\Users\cheungbx\Documents\Arduino\test\test.ino:1:
C:\Users\cheungbx\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/CertStoreBearSSL.h:40:23: error: 'FS' has not been declared
     int initCertStore(FS &fs, const char *indexFileName, const char *dataFileName);
                       ^
C:\Users\cheungbx\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/CertStoreBearSSL.h:46:5: error: 'FS' does not name a type
     FS *_fs = nullptr;
     ^
exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.

It seemed that FS class is declared in FS.h with namespace "namespace fs"
And in CertStoreBearSSL.h the FS is used without the noted namespace and CertStoreBearSSL.h does not see this declared FS class.
If will change the instances of FS in CertStoreBearSSL.h that are causing the errors to fs::FS (adding namespace), then it compiles OK.

MCVE Sketch

Debug Messages


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions