LocalFileSystem error despite including mbed.h

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");  

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

1 Like

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

2 Likes