Jump to content
  • Advertisement
Sign in to follow this  
Harryu

Too many include files error

This topic is 4684 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im getting this error that says: fatal error C1014: too many include files : depth = 1024 i don't really know what it means, so if anybody could help me then it would be really good thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Is it possible some header files have recursive inclusion?

For example

in OMG1.h:
#include <OMG2.h>

in OMG2.h:
#include <OMG1.h>

Share this post


Link to post
Share on other sites
Hey,

You probably have something like the following:

File1.h:
#include "file2.h"

File2.h:
#include "file1.h"

Something.cpp
#include "file1.h"

Basically, an include is a complete paste of the source of the file in at that point. If you have circular references then you'll keep pasting until you get that error.

You can fix it by using inclusion guards to ensure that you haven't included the same file many times.

At the top of your .h files try:
#pragma once

if you're using VC++, or otherwise:
#ifdef __FILE1_INCLUSION
#define __FILE1_INCLUSION
.. <- file content goes here
#endif

but make sure that each of the files use different names for the inclusion.

Hope this helps,

CJM

[edit: beaten!]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!