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

Build Fails Without Deployment #14

Open
LeStarch opened this issue Jul 15, 2024 · 6 comments
Open

Build Fails Without Deployment #14

LeStarch opened this issue Jul 15, 2024 · 6 comments

Comments

@LeStarch
Copy link
Contributor

Following the steps, but building after "new project" and before "new deployment" causes a crash with "cannot find #include <TimeLib.h>"

@ethancheez
Copy link
Collaborator

ethancheez commented Jul 15, 2024

Did you run:

arduino-cli lib install Time

Instructions are here:

Library Dependencies

Required Dependencies:

arduino-cli lib install Time

If you will be using the TcpClient component, install:

arduino-cli lib install WiFi

@LeStarch
Copy link
Contributor Author

I did. It works with building the deployment. Just not the raw project.

@LeStarch
Copy link
Contributor Author

It might be that some of the hooks for libraries etc are done on deployments and not on the full project build.

@ethancheez
Copy link
Collaborator

ethancheez commented Jul 15, 2024

Right. I see what's going on. Yes you are correct. When running fprime-util build when no deployment is present (i.e. if you want to build for the Led component itself), the arduino-cli wrapper doesn't seem to be importing all the arduino libraries correctly which result in dependency errors.

In the tutorial, I ended up putting the Add Arduino Deployment step near the beginning before running fprime-util build.

Edit: Seems that building the LED component with no deployment works now, but raw project does not work still.

@ethancheez
Copy link
Collaborator

ethancheez commented Jul 15, 2024

FYI, this is not a TimeLib issue. I remember getting a similar error with the SPI and Wire.h libraries, they are also not linked properly when no component/deployment is present in the project. See below:

In file included from /home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriver.cpp:8:
/home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriver.hpp:11:10: fatal error: SPI.h: No such file or directory
   11 | #include <SPI.h>
      |          ^~~~~~~
compilation terminated.
gmake[2]: *** [Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/build.make:91: Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/SpiDriver.cpp.obj] Error 1
[ 75%] Linking CXX static library ../../../lib/rpipicow/libDrv_BlockDriver.a
[ 75%] Built target Drv_BlockDriver
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriverArduino.cpp:8:
/home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriver.hpp:11:10: fatal error: SPI.h: No such file or directory
   11 | #include <SPI.h>
      |          ^~~~~~~
compilation terminated.
gmake[2]: *** [Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/build.make:105: Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/SpiDriverArduino.cpp.obj] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:4926: Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/all] Error 2

@LeStarch
Copy link
Contributor Author

Yes, this call comes from the line: finalize_arduino_executable("${FPRIME_CURRENT_MODULE}") in the deployment CMake. This line fixes library usages...but isn't done at the project level.

For now, I am just tracking the issue.

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

2 participants