Skip to content
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

Fatal Error: SFU.h: No Such File or Directory #361

Closed
ghost opened this issue May 29, 2023 · 4 comments
Closed

Fatal Error: SFU.h: No Such File or Directory #361

ghost opened this issue May 29, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented May 29, 2023

While using PlatformIO for VSCode I got the following compilation error for the Arduino Nano RP2040:

.pio\libdeps\nanorp2040connect\ArduinoIoTCloud\src\utility\ota\OTA-nano-rp2040.cpp:30:10: fatal error: SFU.h: No such file or directory

Using the following test script:

#include <Arduino.h>
#include <ArduinoIoTCloud.h>

void setup() {}
void loop() {}

And using the following platformio.ini:

[env]
framework = arduino
lib_deps = arduino-libraries/ArduinoIoTCloud@^1.11.1
build_type = debug

[env:nanorp2040connect]
platform = raspberrypi
board = nanorp2040connect

[env:esp32dev]
platform = espressif32
board = esp32dev

I am unsure how to fix this error as IntelliSense finds the 213 byte pain-in-the-butt file at ~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src/SFU.h. How should I proceed?

EDIT: Compile also fails for ESP32:

.pio/libdeps/esp32dev/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
@pennam
Copy link
Collaborator

pennam commented May 30, 2023

@MJCoolTech i'm not a platformio user, but you can try to explicitly add SFU as library dependency for nanorp2040connect.

Regarding ESP WiFiNINA is not a dependency for ESP32 board so you should not include that library

@ghost
Copy link
Author

ghost commented May 30, 2023

@pennam Thank you for your response. I have tried forcibly including SFU.h using:

build_flags = -L~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src

Although Bing, who suggested this solution, now says it should be:

build_flags = -L~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src -lSFU

So I'll try that after finishing this. I alternatively tried using

lib_extra_dirs = ~/.platformio/packages/framework-arduino-mbed/libraries

Neither of the attempts I tried so far worked for me.

Thank you for bringing the issue with WiFiNINA.h to my attention. I did not include that library through a header. As you can see in my original comment, I included in my main.cpp file Arduino.h and ArduinoIoTCloud.h only and defined the setup and loop functions as empty functions. That's it. However, I have now set in my platform.ini file:

lib_ldf_mode = chain+

That basically means it will evaluate #ifdefs and such before #includes, so I'll see if that fixes the issue.

Thank you for your response. I hope to be up and running soon. Have a great day!

@ghost
Copy link
Author

ghost commented May 30, 2023

Update: Bing recommended StarCoder, and look at the simple solution:

A conversation where the user gives an error and the response contains a fix.

User: While using PlatformIO for VSCode I got the following compilation error for the Arduino Nano RP2040:

.pio\libdeps\nanorp2040connect\ArduinoIoTCloud\src\utility\ota\OTA-nano-rp2040.cpp:30:10: fatal error: SFU.h: No such file or directory

Using the following test script:

#include <Arduino.h>
#include <ArduinoIoTCloud.h>

void setup() {}
void loop() {}

And using the following platformio.ini:

[env]
framework = arduino
lib_deps = arduino-libraries/ArduinoIoTCloud@^1.11.1
build_type = debug

[env:nanorp2040connect]
platform = raspberrypi
board = nanorp2040connect

I am unsure how to fix this error as IntelliSense finds the 213 byte pain-in-the-butt file at ~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src/SFU.h as part of the platform and not in the library manager. How should I proceed?

Response:

You can use lib_ldf_mode = deep+ option in platformio.ini instead of lib_ldf_mode = chain+ because deep+ will search for the library in the project folder.

That easy. After 45 minutes of compilation on my Celeron CPU, I have 118 errors of -Wvla, -Wdeprecated-copy, and -Wdeprecated-declaration, but I have compiled code for the Arduino Nano RP2040 that does nothing by design! ESP32dev still fails, though.

@ghost
Copy link
Author

ghost commented May 30, 2023

The ESP issue is due to WiFiNINA, so I will close this issue.

@ghost ghost closed this as completed May 30, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant