LeifHomieLib icon indicating copy to clipboard operation
LeifHomieLib copied to clipboard

No longer can compile with errors from library

Open ubergeekseven opened this issue 3 years ago • 3 comments

It has been a couple years since building some devices and I thought I would create a few more. Tried original code I had with original setup in vscode with pio. Had it working great at one point. Would not compile. vscode is ridiculous and pio only adds to that. Anyway, I uninstalled all the libraries, reinstalled and updated everything. went through all information on all dependencies and now I am almost there but this library is throwing something I have not encountered before.

this is the output when I try now:

.pio\libdeps\d1_mini\LeifHomieLib\src\HomieNode.cpp: In member function 'void HomieProperty::OnMqttMessage(char*, char*, AsyncMqttClientMessageProperties&, size_t, size_t, size_t)': .pio\libdeps\d1_mini\LeifHomieLib\src\HomieNode.cpp:387:15: error: aggregate 'std::string temp' has incomplete type and cannot be defined 387 | std::string temp; | ^~~~ Compiling .pio\build\d1_mini\FrameworkArduino\WString.cpp.o *** [.pio\build\d1_mini\lib225\LeifHomieLib\HomieNode.cpp.o] Error 1

Any insight on this would be great. This project worked so well once compiled and has been in several lighting setups in my home with openhab and the auto discovery through the homie setup. Would prefer to try and use this again.

ubergeekseven avatar Jul 11 '21 13:07 ubergeekseven

I went down a rabbit hole over the past 4 hours and found something to grab at. Had no idea it would be needed or why because I did not write this library but, I had to declare #include for it to resolve itself. it compiled after that but I have no idea why the rest of the std lines worked without issue.

ubergeekseven avatar Jul 11 '21 17:07 ubergeekseven

I'm stuck with the same problem. What #include did you insert and where ? Thanks

rdu70 avatar Jan 07 '22 20:01 rdu70

I found the answer: Need to add : #include in HomieNode.h I added at line 5 after #include Please update the repo Thanks

rdu70 avatar Jan 07 '22 21:01 rdu70