I am abstracting some functions that vary from project to project. I sometimes use the on-board FuelGauge to read battery voltage and sometimes read battery voltage through other means. If I create a local library with function
getBattV() that uses a FuelGauge object, the linking fails with
multiple definition of '<FuelGauge Object Name>'.
My project looks like this:
├── lib │ ├── boardv02 │ │ └── src │ │ ├── boardv02.cpp # uses the FuelGauge object │ │ └── boardv02.h # declares the FuelGauge object ├── project.properties └── src └── project.cpp # includes boardv02.h
I ran into another problem related to FuelGauge that makes me think it is not very robust. Is there anything obviously wrong with the above approach?