Problem with Libraries: Program Doesn't Build

Hi everyone, I get the following problems when I try to build my program:

Does anyone have a solution?

Thank you in advance.

Adriano

That the library is incompatible with the ESP8266 seems to be a known issue, as you can read in the library’s issue page: The library does not compile for ESP8266 · Issue #4 · peterus/ESP-FTP-Server-Lib · GitHub.

The author of the issue has a compile-fixed version at GitHub - akoro/ESP-FTP-Server-Lib but says it’s not quite functional. If you want to try it, just remove the old

lib_deps =
   peterus/ESP-FTP-Server-Lib @ ^0.9.6

line in the platformio.ini and replace it with

lib_deps =
   https://github.com/akoro/ESP-FTP-Server-Lib/archive/refs/heads/master.zip

Hi Max, thanks for your reply.

I have done what you advised, however the program is still not compiling and I am still getting the same errors.

Do you have any other suggestion?

Thanks.

Indeed, it’s still an uncompilable mess :confused:

n file included from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src/FatLib/FatFile.h:36:0,
                 from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src/FatLib/ArduinoFiles.h:33,
                 from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src/FatLib/FatLib.h:27,
                 from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src/SdFat.h:33,
                 from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\SDFS\src/SDFS.h:36,
                 from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\SD\src/SD.h:25,
                 from src\main.cpp:3:
C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src/FatLib/FatApiConstants.h:104:19: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'const char*' [-fpermissive]
 #define O_READ    O_RDONLY
                   ^
C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\SD\src/SD.h:28:26: note: in expansion of macro 'O_READ'
 #define FILE_READ sdfat::O_READ
                          ^
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src/FTPFilesystem.h:18:52: note: in expansion of macro 'FILE_READ'
  File open(const String & path, const char* mode = FILE_READ);
                                                    ^
src\main.cpp: In function 'void setup()':
src\main.cpp:21:2: warning: 'SPIFFS' is deprecated (declared at C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  SPIFFS.begin(true);
  ^
src\main.cpp:21:19: error: no matching function for call to 'fs::FS::begin(bool)'
  SPIFFS.begin(true);
                   ^
src\main.cpp:21:19: note: candidate is:
In file included from src\main.cpp:2:0:
C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/FS.h:204:10: note: bool fs::FS::begin()
     bool begin();
          ^
C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/FS.h:204:10: note:   candidate expects 0 arguments, 1 provided
src\main.cpp:22:21: error: no matching function for call to 'SPIClass::begin(int, int, int)'
  SPI.begin(14, 2, 15);
                     ^
src\main.cpp:22:21: note: candidate is:
In file included from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\SDFS\src/SDFS.h:35:0,
                 from C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\SD\src/SD.h:25,
                 from src\main.cpp:3:
C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\SPI/SPI.h:56:8: note: void SPIClass::begin()
   void begin();
        ^
C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\libraries\SPI/SPI.h:56:8: note:   candidate expects 0 arguments, 3 provided
src\main.cpp:44:29: error: no matching function for call to 'FTPServer::addFilesystem(const char [3], SDClass*)'
  ftp.addFilesystem("SD", &SD);
                             ^
src\main.cpp:44:29: note: candidate is:
In file included from src\main.cpp:6:0:
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src/ESP-FTP-Server-Lib.h:20:7: note: void FTPServer::addFilesystem(String, fs::FS*)
  void addFilesystem(String Name, FS * const Filesystem);
       ^
Compiling .pio\build\huzzah\libd83\ESP-FTP-Server-Lib\ESP-FTP-Server-Lib.cpp.o
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src/ESP-FTP-Server-Lib.h:20:7: note:   no known conversion for argument 2 from 'SDClass*' to 'fs::FS*'
src\main.cpp:45:31: warning: 'SPIFFS' is deprecated (declared at C:\Users\Max\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
Compiling .pio\build\huzzah\libd83\ESP-FTP-Server-Lib\FTPConnection.cpp.o
  ftp.addFilesystem("SPIFFS", &SPIFFS);
                               ^
*** [.pio\build\huzzah\src\main.cpp.o] Error 1
In file included from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPCommand.h:7:0,
                 from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPConnection.h:7,
                 from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\ESP-FTP-Server-Lib.h:8,
                 from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\ESP-FTP-Server-Lib.cpp:1:
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPFilesystem.h:18:52: error: 'FILE_READ' was not declared in this scope
  File open(const String & path, const char* mode = FILE_READ);
                                                    ^
In file included from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPCommand.h:7:0,
                 from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPConnection.h:7,
                 from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\ESP-FTP-Server-Lib.h:8,
                 from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPConnection.cpp:5:
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPFilesystem.h:18:52: error: 'FILE_READ' was not declared in this scope
  File open(const String & path, const char* mode = FILE_READ);
                                                    ^
*** [.pio\build\huzzah\libd83\ESP-FTP-Server-Lib\ESP-FTP-Server-Lib.cpp.o] Error 1
In file included from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPConnection.cpp:8:0:
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\Commands/CWD.h: In member function 'virtual void CWD::run(FTPPath&, const std::vector<String>&)':
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\Commands/CWD.h:23:46: error: call to 'fs::File FTPFilesystem::open(const String&, const char*)' uses the default argument for parameter 2, which is not yet defined
   File dir = _Filesystem->open(path.getPath());
                                              ^
In file included from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPConnection.cpp:10:0:
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\Commands/LIST.h: In member function 'virtual void LIST::run(FTPPath&, const std::vector<String>&)':
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\Commands/LIST.h:21:55: error: call to 'fs::File FTPFilesystem::open(const String&, const char*)' uses the default argument for parameter 2, which is not yet defined   
   File dir = _Filesystem->open(WorkDirectory.getPath()); //
                                                       ^
In file included from .pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\FTPConnection.cpp:14:0:
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\Commands/RETR.h: In member function 'virtual void RETR::run(FTPPath&, const std::vector<String>&)':
.pio\libdeps\huzzah\ESP-FTP-Server-Lib\src\Commands/RETR.h:28:33: error: call to 'fs::File FTPFilesystem::open(const String&, const char*)' uses the default argument for parameter 2, which is not yet defined   
   _file = _Filesystem->open(path);
                                 ^
*** [.pio\build\huzzah\libd83\ESP-FTP-Server-Lib\FTPConnection.cpp.o] Error 1
===========================

The only to get this fixed is by either working on it yourself or getting the author to fix it.

:+1: Thank you for letting me know!