undefined reference to `esp_vfs_fat_spiflash_mount

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

undefined reference to `esp_vfs_fat_spiflash_mount

Postby Fugazi » Tue May 09, 2017 3:06 pm

trying to get the wear levelling example in espidf working in arduino

https://github.com/espressif/esp-idf/bl ... ple_main.c

Compiles under the espidf make

Add the Arduino component, receives an error regarding the variables in the line

const esp_vfs_fat_mount_config_t mount_config = {
.max_files = 4,
.format_if_mount_failed = true
};

which are the wrong way round - corrected that and it fails on :-

C:\Users\Fugazi\Documents\sloeber-workspace\wl\Release/../wl.ino:54: undefined reference to `esp_vfs_fat_spiflash_mount(char const*, char const*, esp_vfs_fat_mount_config_t const*, int*)'
C:\Users\Fugazi\Documents\sloeber-workspace\wl\Release/../wl.ino:79: undefined reference to `esp_vfs_fat_spiflash_unmount(char const*, int)'

Spent the whole day trying every which way possible to sort this, please someone help !!! ? :)

Thanks

User avatar
martinayotte
Posts: 141
Joined: Fri Nov 13, 2015 4:27 pm

Re: undefined reference to `esp_vfs_fat_spiflash_mount

Postby martinayotte » Tue May 09, 2017 6:17 pm

In your INO sketch, do you simply include the "esp_vfs_fat.h" ?
In such case, linker try to find the functions as C++ not C, and there are not in the library ...
You need to include it that way :

Code: Select all

extern "C" {
    #include "esp_vfs_fat.h"
}

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Re: undefined reference to `esp_vfs_fat_spiflash_mount

Postby Fugazi » Tue May 09, 2017 10:11 pm

Thanks !!

Totally forgot that :)

Should be ok now!

Who is online

Users browsing this forum: jespertp and 51 guests