In the h file i declare:
static IDataSynchronization& sync_data_;
But in the cpp , I have compilation error for sync_data_ :
IDataSynchronization& MasterSlaveSynchronize::sync_data_;
Error is :
MasterSlaveSynchronize::sync_data_ declared as reference but not initialized
I can , but dont want to declare is as a pointer and i want to learn what is the problem here and if there is a way to bypass this.
I cannot initialize at declaration , because this is kind of callback that will pass at setup (no constructor , static setup).
Thank you
You can, but you need to initialize it: