mcci-catena / Modbus-for-Arduino

Modbus library for Arduino
GNU Lesser General Public License v2.1
6 stars 6 forks source link

Cannot compile master: Catena_PollableInterface.h not found #35

Closed matthijskooijman closed 4 years ago

matthijskooijman commented 4 years ago

I believe a recent (last two weeks) commit broke compilation. After updating the library, I get:

In file included from /home/matthijs/docs/Electronics/Arduino/Sketches/libraries/Modbus-for-Arduino/src/lib/cCatenaModbusRtuHost_poll.cpp:17:0:
/home/matthijs/docs/Electronics/Arduino/Sketches/libraries/Modbus-for-Arduino/src/lib/../Catena_ModbusRtuHost.h:21:38: fatal error: Catena_PollableInterface.h: No such file or directory
compilation terminated.

This .h file is referenced from inside the library, but not present. Maybe the file was forgotten?

terrillmoore commented 4 years ago

Compiling that file requires that you also install https://github.com/mcci-catena/Catena-Arduino-Platform. Of course, not everyone wants to. This problem was introduced when I refactored to pull the poll() method implementation out of the .h file but this then introduces the dependency. Solution is to move the poll method implementation back to the .h file, so if you don't #include the Catena wrapper, you won't get this.

Workaround is to remove offending file, as it won't be used unless you also are using the platform.

Need to attend to #17, although #17 might not have found this because I would have installed the Catena-Arduino-Platform library by default. Long term may need to split the library.

terrillmoore commented 4 years ago

@matthijskooijman I compiled several other (non-example) sketches, and I found that I had to be more elaborate in my backward-compatibility approach. New fix pending that seems to work for everything.

terrillmoore commented 4 years ago

@matthijskooijman if you could temporarily switch to https://github.com/mcci-catena/Modbus-for-Arduino/commit/0460b9fbc081a8cdb2097e77a15604872ee0dd6c (branch issue35b) and test compile, I'd appreciate it.

matthijskooijman commented 4 years ago

Thanks! Just tested issue35b, which seems to work for my sketch (only compiletested, I do not have hardware at hand to test).

terrillmoore commented 4 years ago

OK, I'll merge. I've checked all my projects and it seems OK.