Problem with forward declaration
C++ Gurus
5
Posts
4
Posters
4.8k
Views
1
Watching
-
Hi all,
I've got a problem with a forward declaration. My source tree structure is as follows:@
- src
role.h
role.cpp- daemon
daemon.h
daemon.cpp
@
- daemon
where daemon.h uses Role via forward declaration:
@
// daemon.h// forward declaration of the Role implementation
class Role;class Daemon : public QObject{
...QList<Role> roles();
}
@and when I compile the project I got the following error for the Daemon::roles() method:
@error: ‘Role’ was not declared in this scope@
Am I missing something?
- src