Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. [Solved]Forbidden Declaration...
QtWS25 Last Chance

[Solved]Forbidden Declaration...

Scheduled Pinned Locked Moved Brainstorm
4 Posts 2 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rosh1985
    wrote on 19 Feb 2011, 03:14 last edited by
    #1

    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!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on 19 Feb 2011, 09:27 last edited by
      #2

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

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rosh1985
        wrote on 19 Feb 2011, 09:42 last edited by
        #3

        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!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on 19 Feb 2011, 09:57 last edited by
          #4

          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.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0

          3/4

          19 Feb 2011, 09:42

          • Login

          • Login or register to search.
          3 out of 4
          • First post
            3/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved