# Strange include directory ordering issue

## Recommended Posts

Hey all,

After much gnashing of teeth, wailing, and general hair pulling, I finally got my program to compile. But it required a strange setup of the include directories. And I'm not sure why.

My solution has three projects in it so far. The main one is sitting at:

D:\Enzyme\Trunk\Engine

This one compiles just fine.

Then there is a second project, which is a DLL, sitting at:

D:\Enzyme\Trunk\Engine\Tools\FontBuilder

Okay? The third is of no consequence to this problem.

My issue with the DLL project is that I couldn't get it to compile. I was getting ALL SORTS of really weird errors that made no sense. Well, as I said, I finally got it fixed, but ONLY by putting in a very odd ordering of the include directories for this particular project.

The DLL project needs to pull .h files from the engine directory, so I added "..\.." to the VC++ Directories->Include Directories entry. And that is where my problems began. I also had the "Inherit from Parent or Project Defaults" checkbox checked. And this was giving me all sorts of grief.

I finally discovered to compile the project, I had to put the order of the include directories in this EXACT order.

C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;
$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;
$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;
..\..;

The middle four lines being the project defaults. Specifically, it's the line
\$(WindowsSdkDir)include;
that has to come prior to the line
..\..;

If those two are in reverse order, I get those strange errors. Why should that be? There is nothing in the engine directory in terms of .h files that would conflict with what is in the Windows SDK directory (at least, none that I could see).

So what gives? Why the order dependency?

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627654
• Total Posts
2978447

• 10
• 12
• 22
• 13
• 33