jbilander / ESP32-FTP-Server

FTP-Server for the ESP32 using SdFat (Arduino FAT16/FAT32/exFAT Library) for storage
GNU General Public License v2.0
2 stars 0 forks source link

Compilation error: File is undefined #1

Open maxbrito500 opened 1 year ago

maxbrito500 commented 1 year ago

Hello,

Thank you for adding sdFat support. I was trying the code on PlatformIO, downloaded and then tried to run. However, it fails on the compilation.

This is the error message:

lib/FTP_server/FTPCommand.h: In member function 'void FTPCommandTransfer::abort()':
lib/FTP_server/FTPCommand.h:125:13: error: '_file' was not declared in this scope
         if (_file)
             ^~~~~

Would you have any idea why?

Thanks!

jbilander commented 1 year ago

Hi, I'm not using PlatformIO but maybe it has to do with the include path. I have a libraries folder where my libs are located and with a path set in config like this: https://github.com/jbilander/ESP32-FileServer/blob/main/.vscode/c_cpp_properties.json#L8

You can see this code where I use the FTP-library from another project: https://github.com/jbilander/ESP32-FileServer/blob/main/ESP32-FileServer.ino

good luck

maxbrito500 commented 1 year ago

Hello Jorgen, thank you for the quick reply.

It seems to be related to the file variable itself not being declared somewhere on the code.

In case it helps, I'm adding the FTP code on this project: https://github.com/radio3-network/B3OS/blob/7083b5784b440432993f84c3ddf4c6e98b7e2f77/src/apps/terminal/ftp_server.cpp#L33

I'm just copying the src folder, renaming it to "FTP_server" and that's it. Other projects worked OK with that approach.

Would you know if that variable file is declared elsewhere?

jbilander commented 1 year ago

Hi, not sure how platformio works but in VSCode I need to have library.properties file for it to pick up the files in the src-folder. This is how my libraries folder looks:

image

and in the project that uses the libraries I do the includes with <> around since they are libraries:

include

include

include

include

include

Hope it helps