Git Product home page Git Product logo

Comments (3)

a9183756-gh avatar a9183756-gh commented on June 14, 2024

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.

Jonas18175 avatar Jonas18175 commented on June 14, 2024

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.

a9183756-gh avatar a9183756-gh commented on June 14, 2024

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

  1. Hook into the CMake compilation stage and make the auto-link solution compatible with Arduino IDE. (or)
  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.