#include nested too deeply error

Hello everyone,

My Xcode is acting all crazy for some reason by giving me this error on all of my #include's that says, "#include nested too deeply". Is there a way to fix this so I can use Xcode normally again? It's only happening in my Game header file.

1
2
3
4
#include <iostream>  // #include nested too deeply (is what the error says)
#include <string>    // #include nested too deeply
#include "Game.hpp"  // #include nested too deeply
using namespace std;


Last edited on
closed account (z05DSL3A)
looks like a cyclic include...
1
2
3
//...
#include "header2.h"
//... 
header1.h
1
2
3
//...
#include "header1.h"
//... 
header2.h
So how should I go about fixing this?
closed account (z05DSL3A)
Well, you would have to find out what the dependancy is and move it (breaking the cycle).

It's a bit hard to say more than that as it stands.

Try include guards.
http://www.cplusplus.com/forum/general/71787/

If you use Visual Studio you can also use #pragma once at the begin of the header file.
Topic archived. No new replies allowed.