-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with out of the box #197
Comments
Seems like a not-esp_littlefs-specific environment issue, have you successfully compiled other projects using your environment? Just to be absolutely sure, I updated the CI in #198 to explicitly test building the example with esp-idf v5.3 (and it works fine). |
Yes, other projects will compile with their default Eclipse Esspressif-IDE solution. You're using the command line version of ESP-IDF then to build it? The reason I reported it here is I'm unclear why the filename would be .c vs .cpp if it's intended to be a C++ compiled project. Seems that the environment is presuming .c file should be compiled a standard C which seems to be creating the issue. |
This port |
It would appear that it's picking up the C++ string file instead. If I force the language mappings to use gnu C compiler instead then things compile. By default I think the .h files must get mapped to C++ header files based on the extension names. https://en.cppreference.com/w/cpp/header/cstring I think the right way to fix this to be both C and C++ compatible would be something like this:
or
Maybe wrapping an extended portion of the library that way. |
Another side that might be of interest to those stumbling on this thread, there might be an issue with the default MacOS python3 driving some of this. The default /usr/bin/python3 version is 3.9.6 but if you install the brew 3.12.4 version and force ESP-IDF to use that instead then it seems to compile out of the box. I'm not sure why that makes a difference. The generated file is the same, but for some reason it seems to be impacting how the compiler/linker behave too. That might be why the CI test created earlier ran fine too. I did notice that the extern "C" doesn't wrap the header file includes in the generated files, which might address the problem regardless. At any rate - maybe that will help others. Appreciate the help! |
thanks for the follow up! Just to clarify, is any action required on my part? The esp_littlefs header has the cpp guard, as does littlefs. |
The header includes are outside the extern "C" guard in the file I saw generated. I'm thinking that for better compliance on a strict compiler that including them within that wrapper would probably help. I have no idea why the python version makes a difference, but at least gives people another option to handle. |
I'm using Espressif-IDE (their prebuilt) 5.3. The LittleFS demo isn't working and it appears that it's because of the .c extension but trying to pull in the C++ string.h library from lfs_utils.h.
The text was updated successfully, but these errors were encountered: