undefined references in static class ???

Linker undefined reference … I guess.
At the end of the compile of a large program (20 classes - 10 libraries) I get the following:

_variables are defined and implemented as private variables in log.h/.cpp (see attached test References sketch). They are all referenced in json.cpp.

Any suggestions on how I can get to the bottom of this?
Thanks - Abbott

Error (.text+0x2de): undefined reference to LogClass::_vacuumPsi
Error (.text+0x2e0): undefined reference to LogClass::_vacuumPsi
Error (.text+0x2e8): undefined reference to LogClass::_vacuumPsi
Error (.text+0x2ea): undefined reference to LogClass::_vacuumPsi
Error (.text+0x306): undefined reference to LogClass::_flowTot
Error (.text+0x308): undefined reference to LogClass::_flowTot
Error (.text+0x310): undefined reference to LogClass::_flowTot
Error (.text+0x312): undefined reference to LogClass::_flowTot

etc …

References.zip (353 KB)

I figured this out...finally.
I had declared my static variables as private in the header.
WHen I moved them to the class body(removing the private: and LogClass:: from the property.
This was a week from hell for me.

Static variables are handled a bit different than normal member variables.

There are 2 ways:

  1. in class definition: the static variable must be a constexpr.
    (Edit: constexpr is read only)
class A 
{
   static constexpr int num = 0;
}
  1. declare your variable in the header, but define it in the cpp file.
.h
class A 
{
   static int num;
};

.cpp
int A::num = 0;