[Solved]Forbidden Declaration...



  • 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!



  • 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;
    @



  • 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!



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.