That is good but not sufficient. If you don’t declare global variables in this header file as extern
, this will cause a multiple definition in every single .cpp file that includes this header.
This has e.g. been discussed in Splitting cpp files - #2 by maxgerhardt