Error: C2228: left of '' must have class/struct/union Error: C2228: left of '' must have class/struct/union sqlite sqlite

Error: C2228: left of '' must have class/struct/union


You made an error here:

DatabaseControl myDBControl();

You declared a function called myDBControl taking no arguments and returning a DatabaseControl.

Object declarations without any constructor arguments must omit the ():

DatabaseControl myDBControl;

This is related to (but is not precisely) the "most vexing parse", in that it's caused by the same language rule that statements are function declarations if they can be so parsed.


DatabaseControl myDBControl();

should be

DatabaseControl myDBControl;


You need to say this:

 DatabaseControl myDBControl; myDBControl.addEmployee();