Results 1 to 5 of 5

Thread: AVOIDING mutiple inclusion of header file???

  1. #1
    Join Date
    Jul 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default AVOIDING mutiple inclusion of header file???

    HI

    HOW CAN WE AVOID MULTIPLE INCLIUSION OF HEADER FILE IN QT??

    OTHER THAN WRAPPING .H FILE IN #endif,#include etc

    can we give something like:-

    <class_ name> *<class_object> in a header file

    eg if v have a class EUREKA, can v do:-

    EUREKA *e[3];

    to make 3 pointer of type class EUREKA in a .h file

    if not how can v declare such pointers if v have to use them across other classes

    THANK U

  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: AVOIDING mutiple inclusion of header file???

    I don't mean to be rude, but what does this have to do with Qt? It's basic C/C++. And please don't shout.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: AVOIDING mutiple inclusion of header file???

    You can use forward declarations to avoid including header files in other header files, but they will allow you only to declare pointers and references.

  4. #4
    Join Date
    Jul 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy multiple inclusion-linker error in QT4.2

    sorry to bother all of u again but i already know how to implement the following in c/c++,

    turbo c++,borland c++, c#, VC++(MFC), java(core), the thing is the problem is peculiar

    with QT.......... and its giving the error........i didn't mean to shout but i was

    desperate......


    HI

    HOW CAN WE AVOID MULTIPLE INCLIUSION OF HEADER FILE IN QT??

    OTHER THAN WRAPPING .H FILE IN #endif,#include etc

    can we give something like:-

    <class_ name> *<class_object> in a header file

    eg if v have a class EUREKA, can v do:-

    EUREKA *e[3];

    to make 3 pointer of type class EUREKA in a .h file

    if not how can v declare such pointers if v have to use them across other classes

    THANK U

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: multiple inclusion-linker error in QT4.2

    Please, don't shout and don't start multiple threads on the same topic.

    Read about forward declarations.

Similar Threads

  1. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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.