Hi Chris,
thanks for the quick help. I guess I should learn more about pointers and instances. I went with the instance suggestion and now I get past this but it is still not compiling. As I thought, the issue is at declaring the vector:
Undefined symbols for architecture x86_64:
"Employee::Employee()", referenced from:
QVector<Employee>::defaultConstruct(Employee*, Employee*) in mainwindow.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Team.app/Contents/MacOS/Team] Error 1
Undefined symbols for architecture x86_64:
"Employee::Employee()", referenced from:
QVector<Employee>::defaultConstruct(Employee*, Employee*) in mainwindow.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Team.app/Contents/MacOS/Team] Error 1
To copy to clipboard, switch view to plain text mode
So how can I declare a QVector with a custom class that needs an input that I do not have at that moment?
Here is how my class looks:
class Employee{
public:
Employee();
[...]
}
class Employee{
public:
Employee();
Employee(const QSqlQuery *query, const QString &level);
[...]
}
To copy to clipboard, switch view to plain text mode
I thought by using Employee(); I can create an object of Employee without the need to pass on anything. Is this not correct?
Bookmarks