Closed kaidegit closed 2 years ago
It is possible that those errors are reported depending on your particular environment and how the .h file is included. Your solution will work just fine.
I think it is very often to include modbus.h
at least 2 times, one is in modbus.c
and the other is where we use these modbus apis. So may it is ineluctable to cause multiple definition of 'mHandlers'
.
I updated the library to solve this issue.
https://github.com/alejoseb/Modbus-STM32-HAL-FreeRTOS/blob/master/MODBUS-LIB/Inc/Modbus.h#L234
The definition in
modbus.h
causes some compilation errors likemultiple definition of 'mHandlers'
.May extern it in
modbus.h
and define it inmodbus.c
?