Hi, there are a better way:
in the Power.h file you just need to use ‘inline’ before the global variable/objects, like:
//global vars
inline float shuntvoltage_A = 0;
//global objects
inline Adafruit_INA219 ina219_A;
inline Adafruit_INA219 ina219_B(0x41);
with that you can declare and define the variable/object in the .h file, so isn’t neccesary to do the definition in the .cpp file.
read more: C++ Global variable declaration - Stack Overflow
also, if is compiling fine, but compiler show some warnings I recommend to configure your platformio.ini file to compile with a newer version of C++, like that:
build_unflags = -std=gnu++11 ;Old version
build_flags = -std=gnu++2a ;Use new version
You can read this:
I just open this account to share this solution, because I had the same problem as meathome2017, so I hope this can be helpfull to someone in the future