Jump to content
  • Advertisement
Sign in to follow this  

Too many include files error

This topic is 5191 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
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

You probably have something like the following:

#include "file2.h"

#include "file1.h"

#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:
.. <- file content goes here

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

Hope this helps,


[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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!