Closed InventoCasa closed 3 years ago
@Invento3D
Thanks for using the library and your opinion.
I won't change as suggested as I don't like to loose the benefit of the current way. Many people are also able to use the library as is. The limited number of people having your kind of problem, by using complicated code, with the knowledge, should know the simple way to modify several lines of the library.
Anyway, in the next release, I'll
multiple definition errors
.Sorry, but your target users are not well-experienced C++ developers, but most likely mainly people out of the maker area which will not have as much C++ experience as you may think.
Apart from that, only because header-only files have become quite popular in the C++ community does not mean that they are suited for every use case. Your header-only file basically consists out of non-template function definitions. If now the header file is included in more than one translation unit, the function would be defined multiple times.
Please consider either
I'm also not sure why you used so many preprocessor directives instead of just using constants.
I'll update later with the simple solution similar to this
See ESP_WiFiManager v1.2.0 and Contributions-and-Thanks
multiple definition
linker error. See Change Implementation to seperate *.h and *.cpp file instead of *.h and *-Impl.h
and Support building in PlatformIO PR
. Also have a look at HOWTO Fix Multiple Definitions Linker Error
I had a lot of problems integrating your library into my code, mainly because of the strange way of using an ESP_WiFiManager-Impl.h file instead of a .cpp file.
I got the same errors as described in this pull request --> a lot of
multiple definition
errors. I suggest that you change that, since most people are not used to this.