[Solved]Forbidden Declaration...
-
wrote on 19 Feb 2011, 03:14 last edited by
Hi all,
I'm relatively new to Qt C++ programming, and as such I have been following the tutorial "Address Book" on this website (using linux). I have completed the code, and the only errors i get when debugging are "ISO C++ forbids declaration "FindDialog" with no type" and "expected ';' before (*) token".
the snippet of code this is referring to is in addressbook.h, in particular the line;
private:
...
FindDialog *dialog;
...i'm totally sure of why i get these errors, I have followed the tutorial, and the rest of the code up to this point is fine from what i can see. I tested it at the completion of each section, and this is where the first error came up. Numourous other errors were present but i was able to work out why and fixed them (not declared etc)
Greatly appreciate any help with this!
Thanks! -
wrote on 19 Feb 2011, 09:27 last edited by
Where is FindDialog defined?
I think, there are two solutions to that (if it is the problem I think):
include the header file of FindDialog in your header
make a pre definition in your header at the top:
@
class FindDialog;
@ -
wrote on 19 Feb 2011, 09:42 last edited by
thanks for the reply, I have managed to work out my issue not long ago just before your comment, i did basically what you said here.
i had missed the inclusion of the Find Dialog header file in my other header file that was using the private reference of FindDialog *dialog.
Rooky mistake, but thats how we learn.
Thanks for getting back to my comment, much appreciated!
-
wrote on 19 Feb 2011, 09:57 last edited by
Hi rosh1985,
as your problem is solved, please mark this thread as solved:
click on your first posts' edit link, change the title and add [Solved] in the beginning, so everybody knows, it's done.Thanks.
3/4