. Advertisement .
..3..
. Advertisement .
..4..
I encounter the error ”left of must have class/struct/union” when I run the following line:
void MainWindow::on_addEmployee_clicked()
{
DatabaseControl myDBControl();
myDBControl.addEmployee();
}
Can someone help me to solve it? Thanks!
The cause: I think the error is here:
You created the
myDBControl
function, which accepts no arguments and outputs aDatabaseControl
.Solution: Don’t use the
()
when declarating object without any constructor arguments: