You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When including this library in multiple files you get the the following error(s):
(.text+0x0): multiple definition of `Modbus::Modbus(unsigned char, Stream&, unsigned char)'
This is easily solved with the following modifications:
Placing a "ifndef" around the header code.
#ifndef MODBUS_RTU_H
#define MODBUS_RTU_H
....
#endif
creating a ModbusRtu.cpp file to split definition from declaration.
All code down from the next line must be moved to the .cpp file.
/* PUBLIC FUNCTIONS________________________________________________ */
and obviously include the header file at the top of the .cpp file. :)
#include <ModbusRtu.h>
The text was updated successfully, but these errors were encountered:
When including this library in multiple files you get the the following error(s):
(.text+0x0): multiple definition of `Modbus::Modbus(unsigned char, Stream&, unsigned char)'
This is easily solved with the following modifications:
Placing a "ifndef" around the header code.
#ifndef MODBUS_RTU_H
#define MODBUS_RTU_H
....
#endif
creating a ModbusRtu.cpp file to split definition from declaration.
All code down from the next line must be moved to the .cpp file.
/* PUBLIC FUNCTIONS________________________________________________ */
and obviously include the header file at the top of the .cpp file. :)
#include <ModbusRtu.h>
The text was updated successfully, but these errors were encountered: