Results 1 to 2 of 2

Thread: problem with an include

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default problem with an include

    hi, I declare QImage qi as private var of mainForm in desinger; then I added #include "qimage.h" in implementation (from desinger). ti gets me error; but it work if I inserted include in declaration (from deisger) why this??? I declared others variabiles in the same way and don't get any errors......
    Qt Code:
    1. ...tor\ui\mainform.h(318): error C2079: 'MainForm::qi' uses undefined class 'QImage'
    To copy to clipboard, switch view to plain text mode 
    Regards

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: problem with an include

    The compiler must know the exact type of the member variable so it knows how much to allocate memory for the constructed object and so on. There is no way for the compiler of knowing what type is a QImage in the mainform.h file, if you haven't a proper include there. A forward declaration would be sufficient if it was a pointer, though.
    J-P Nurmi

Similar Threads

  1. QApplication: no such file or directory
    By jochen_r in forum Newbie
    Replies: 13
    Last Post: 15th November 2008, 21:46
  2. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  3. Replies: 7
    Last Post: 2nd June 2006, 12:48
  4. Thread Problem
    By qball2k5 in forum Qt Programming
    Replies: 2
    Last Post: 12th April 2006, 17:31
  5. use button from another Window
    By raphaelf in forum Qt Programming
    Replies: 11
    Last Post: 2nd March 2006, 20:31

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.