Results 1 to 14 of 14

Thread: error: ISO C++ forbids declaration of ‘mainScreenDLG’ with no type

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: error: ISO C++ forbids declaration of ‘mainScreenDLG’ with no type

    Quote Originally Posted by GreenScape View Post
    no, Ui::mainScreenDLG must be in ui_menuScreen.h, look for it.
    Greenscape, you seem to be confusing me with the author of the broken program.

    Quote Originally Posted by Baxter
    the object name is "mainScreenDLG" in the file mainScreen.ui (created in Qt Designer)
    i think that it hadnt recognised the mainScreen.ui file until i re-opened it in Designer for some reason. that or i had misnamed it and
    but im still getting the "13: error: expected class-name before ‘{’ token"
    Qmake will generate uic commands for the .ui file "mainScreen.ui" to generate a file "ui_mainScreen.h" that contains the definitions for the objects in the design. Your code defining "class mathsGame" (first post) includes a file called "ui_menuScreen.h", which presumably relates to a different Designer form that does not define mainScreenDLG.
    on a related note, the code from my "mainScreen.cpp" file is experiencing errors
    Probably because it does not know of an object by the name btnCheck which the error reports as "<unresolved overloaded function type>".

  2. #2
    Join Date
    Jul 2010
    Posts
    1

    Default Re: error: ISO C++ forbids declaration of ‘mainScreenDLG’ with no type

    Baxter

    u try to change class name:mainScreen to myMainScreen or rename other

    mainScreen,MainScreen may be retained by QT Create

Similar Threads

  1. Replies: 12
    Last Post: 29th April 2010, 13:22
  2. Error::defined after prior declaration as dllimport:
    By hasnatzaidi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2009, 01:37
  3. error: forward declaration of 'struct QPushButton'
    By prykHetQuo in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2009, 23:20
  4. forbids declaration of QHash with no type
    By nina1983 in forum Qt Programming
    Replies: 4
    Last Post: 16th July 2008, 13:05
  5. Forward Class declaration ERROR
    By nleverin in forum Qt Programming
    Replies: 1
    Last Post: 30th July 2007, 08:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.