Results 1 to 9 of 9

Thread: need help please

  1. #1
    Join Date
    Apr 2016
    Posts
    4
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default need help please

    Hello guys i have a problem with my project while compiling it
    Please help me
    this is the url of my project
    https://drive.google.com/file/d/0B0A...p=docslist_apiproblem.jpg
    and the pic above show the prob



    it said that "bacterie" (class) hasn't been declared , but its declared !!!!!!!!!!!!!!!!!!!
    Last edited by imed007; 14th April 2016 at 16:38.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: need help please

    What is the problem?

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    imed007 (14th April 2016)

  4. #3
    Join Date
    Apr 2016
    Posts
    4
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: need help please

    Quote Originally Posted by anda_skoa View Post
    What is the problem?

    Cheers,
    _
    sorry for less informations

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: need help please

    can you post bacterie.h?

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    imed007 (14th April 2016)

  7. #5
    Join Date
    Apr 2016
    Posts
    4
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: need help please

    Qt Code:
    1. #ifndef BACTERIE_H
    2. #define BACTERIE_H
    3. #include "dialog.h"
    4.  
    5. class bacterie : public QObject
    6. { Q_OBJECT
    7. public:
    8.  
    9. bacterie();
    10.  
    11. bacterie * set_svt_bacterie();
    12.  
    13. int get_j_bacterie ();
    14.  
    15. int get_i_bacterie ();
    16.  
    17. int get_ue_bacterie ();
    18.  
    19. void Reservebacterie(int &num);
    20.  
    21.  
    22.  
    23. void verrifeirbacterie(bacterie * &b);
    24.  
    25. void delete_bacterie (bacterie *&p );
    26.  
    27. //private :
    28.  
    29. int m_num;
    30. int m_UE;
    31. int m_i;
    32. int m_j;
    33. bacterie * m_prec;
    34. bacterie * m_svt;
    35. QLabel * m_label;
    36.  
    37. };
    38. void affectbacterie(bacterie *&b,int &n,QLabel * p);
    39. #endif BACTERIE_H
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 14th April 2016 at 18:33. Reason: missing [code] tags

  8. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: need help please

    Looks quite ok, but why do you include "dialog.h"?

    Cheers,
    _

  9. The following user says thank you to anda_skoa for this useful post:

    imed007 (15th April 2016)

  10. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,714
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: need help please

    You have at least two circular dependencies in your #include files:

    dialog.h includes bacterie.h, which includes dialog.h
    dialog.h includes bug.h, which includes dialog.h

    Remove #include "dialog.h" from bug.h and bacterie.h and it should compile without problems.

  11. The following user says thank you to d_stranz for this useful post:

    imed007 (15th April 2016)

  12. #8
    Join Date
    Apr 2016
    Posts
    4
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: need help please

    Thank you guys for helping me

  13. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,714
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: need help please

    You should read in your C++ books about "forward declarations". If you use them correctly, you will be able to avoid these kind of problems and will not need to have include files everywhere in your code, but only where they are actually needed.

Tags for this Thread

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.