PlatformIO Community

LocalFileSystem error despite including mbed.h


#1

Hi,

Am getting an error when I try to create a local file for writing. I am using the ST-Discovery-L476VG board.

Error:
src\main.cpp:29:3: error: 'LocalFileSystem' was not declared in this scope

Code:

#include "mbed.h"
....
// Create the local file-system under the name "local"
LocalFileSystem local("local"); 

// Open "test.txt" on the local file system for appending
FILE *fp = fopen("/local/test.txt", "w");  

#2

See https://os.mbed.com/docs/mbed-os/v5.11/apis/filesystem.html


#3

Also needs DEVICE_LOCALFILESYSTEM macro activated. https://github.com/ARMmbed/mbed-os/blob/master/platform/LocalFileSystem.h#L22