I've searched through a number of similar topics but can't find my answer. I'm making a qt app and getting the dreaded Undefined symbols for architecture x86_64:
My code looks like
Header file
class LoginWindow : public QWidget {
Q_OBJECT
std::string getUsername();
std::string getPassword();
public slots:
void setUsername (std::string newUsername);
void setPassword (std::string newPassword);
signals:
void loginAttempt();
void usernameChanged(std::string);
void passwordChanged(std::string);
private:
std::string username;
std::string password;
};
}
C file
void LoginWindow::setUsername(std::string newUsername){
username = newUsername;
emit usernameChanged(username);
}
std::string LoginWindow::getUsername(){
return username;
}
std::string LoginWindow::getPassword(){
return password;
}
If I comment out the emit lines everything seems to work fine.