-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Question/Bug] target_link_arduino_libraries - possible bug #43
Comments
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.
|
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. |
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
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. |
Hello,
I dedected a problem in using of target_link_arduino_libraries.
I installed the ESPAsyncWiFiManager lib and added it to the target_link_arduino_libraries in cmake.
Other libs that I had downloaded and installed works without problems, but on this it had a problem with including/finding DNSServer.h header - which is a lib from Arduino Core.
Is there a workaround for this? My workaround is very ugly:
There are a other way to import finding and import this header? I tried already to add the DNSServer directly to target_link_arduino_libraries.
The text was updated successfully, but these errors were encountered: