Comments (3)
Rather than a hacky workaround, it will be easier if you can share a short script that reproduces the problem, the exact error message and the exact library (github url) that caused the issue.
For reproducing the issue, I tried including ESPAsyncWiFiManager.h (library cloned from https://github.com/alanswx/ESPAsyncWiFiManager), and it required more dependencies ESPAsyncWebServer.h and ESPAsyncTCP.h (cloned from https://github.com/me-no-dev/ESPAsyncWebServer.git and https://github.com/me-no-dev/ESPAsyncTCP.git).
With this, I got the error "DNSServer.h:3:21: fatal error: WiFiUdp.h: No such file or directory".
This error means that DNSServer library could not auto-link with ESP8266WiFi library (Note: WiFiUdp.h is part of ESP8266WiFi). This is because, as discussed for a similar issue in issue 19, auto linking process in the toolchain won't be able to identify WiFiUdp.h as part of ESP8266WiFi library. DNSServer library should have actually included ESP8266WiFi.h, which is the interface file, and not WiFiUdp.h, which is not listed by the library as the interface file.
A simple workaround is to link ESP8266WiFi to DNSServer.
I added the below line to the script and it worked.
target_link_arduino_libraries(DNSServer PUBLIC ESP8266WiFi)
from arduino-cmake-toolchain.
Thank you for your response - sorry for my bad issue request, but I hadn't no idea how I should describe my problem in english... But yes I forgot to Include the compiler output. That seem a easy fix - but when I try this I get an CMake Error: " DNSServer is not a CMake target". Does a fix like this come permanently into the project for things like that? It would be nice if the "ESPLib" is properly supported.
EDIT: It worked I forgot to remove my previous CMake Code.
from arduino-cmake-toolchain.
Good to hear that it worked for you.
Yes, supporting all the libraries out of the box without such a workaround is something that is in the pipeline. Although it is not a good practice to include a non-interface header file (as done in the DNSServer library), such a scenario is supported by Arduino IDE (unfortunately) and the issue escapes detection. The reason why the toolchain currently does not support this scenario is because it requires hooking into the CMake compilation stage, whereas the current auto-link solution is implemented within the CMake configuration stage itself.
There is a plan to fix this issue permanently in one of the following ways
- Hook into the CMake compilation stage and make the auto-link solution compatible with Arduino IDE. (or)
- Maintain a database of hints to such issues within the toolchain, so that it is not required to add this workaround in the project script.
Either ways, there will not be a need to remove the above suggested workaround (using target_link_arduino_libraries) from the project script, and this will remain compatible in the future.
from arduino-cmake-toolchain.
Related Issues (20)
- Sketch (ino) support broken HOT 5
- Prebuild command not execuded before cmake compiler check. HOT 1
- Dependency on the Arduino IDE
- 'Arduino Uno WiFi Rev2' support
- Can't find pins_arduino.h on Attiny85
- Arduino Nano 33 BLE: undefined reference to `main'
- platform.local.txt not supported
- Esp32 tests fail HOT 1
- Upload fails on avr:leonardo HOT 2
- No compiler warnings? Can compiler flags be set on a by-target basis? HOT 2
- `CMAKE_`Lang`_STANDARD`(`_REQUIRED`)? (i.e. `CMAKE_CXX_STANDARD_REQUIRED`) is ignored.
- Support building with clang
- Maintained version HOT 1
- undefined reference to `setup()' HOT 19
- Toolchain build fails on Mac OS with ESP32 Platform v2.x.x HOT 2
- build.opt not found HOT 1
- Query: do you know if this works with the Arduino setup on Mac OS? HOT 4
- Constants not defined during compilation HOT 12
- ARDUINO_INSTALL_PATH not found (and other problems) building with rp2040 core, IDE 2.3.0 & MacOS HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-cmake-toolchain.