Too many include files

This is a discussion on Too many include files within the C++ Programming forums, part of the General Programming Boards category; When I try to build my program, it tells me I have too many include files : depth = 1024. ...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    117

    Too many include files

    When I try to build my program, it tells me I have too many include files : depth = 1024. I have 14 .h files total. Is there a way to fix this without...deleting files?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Obviously 14 is less than 1024. Do you have a file that includes itself, or a pair of headers that include each other (such that you get an infinite circle of inclusions)?

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    117
    Hmm...I have three classes that end up looping with inclusions. That much be the problem.

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    That's what include guards are for.
    Code:
    #ifndef SOME_UNIQUE_STRING
    #define SOME_UNIQUE_STRING
    
    // Put your header code here.
    
    #endif
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  5. #5
    Registered User
    Join Date
    Oct 2009
    Posts
    4
    GameDev.net - Organizing Code Files in C and C++

    That link will help you out with your cyclic dependency problems

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 06:23 AM
  2. Header file include order
    By cunnus88 in forum C++ Programming
    Replies: 6
    Last Post: 05-17-2006, 04:22 PM
  3. include files that are'nt in compiler's directory
    By vaibhav in forum C++ Programming
    Replies: 10
    Last Post: 03-25-2006, 11:45 AM
  4. Include files
    By disruptivetech in forum C++ Programming
    Replies: 7
    Last Post: 07-12-2005, 10:52 AM
  5. include library header in header files
    By Raison in forum C++ Programming
    Replies: 6
    Last Post: 09-27-2004, 03:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21