Results 1 to 5 of 5

Thread: 'CLASS' does not name a type

  1. #1
    Join Date
    Apr 2012
    Location
    Porto
    Posts
    38
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default 'CLASS' does not name a type

    I have this example below. How to solve this problem?

    Qt Code:
    1. class ABC{
    2. private:
    3. XYZ *xyz; //XYZ is not defined yet
    4. };
    5.  
    6. class XYZ{
    7. private:
    8. ABC *abc; //ABC is defined above
    9. };
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: 'CLASS' does not name a type

    Put "class XYZ;" before line #1. And then go and learn about "forward declarations" in C++.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2012
    Location
    Porto
    Posts
    38
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: 'CLASS' does not name a type

    thanks for help =)

  4. #4
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Smile Re: 'CLASS' does not name a type

    Hello ,

    I am using one dialog box for conformation (named d). In that i am trying to create one object for another class(named measure) to access that class variables like
    Measure *m; I got an error as

    'Measure' does not name a type.


    please suggest me where i am doing wrong.

  5. #5
    Join Date
    Aug 2013
    Posts
    2
    Thanked 1 Time in 1 Post

    Default Re: 'CLASS' does not name a type

    Hi, everybody, I am a new friend.

Similar Threads

  1. Replies: 2
    Last Post: 22nd November 2011, 05:19
  2. Replies: 10
    Last Post: 1st May 2011, 18:27
  3. 'Class' does not name a type error
    By naturalpsychic in forum Qt Programming
    Replies: 9
    Last Post: 1st February 2011, 15:43
  4. Replies: 12
    Last Post: 28th May 2010, 00:07
  5. Determine Class Type of QObject Parent
    By photo_tom in forum Qt Programming
    Replies: 2
    Last Post: 12th May 2010, 17:42

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.