views:

249

answers:

3

I looked at previous post based on this but they do not relate. I am receiving the following error.

1>c:\users\numerical25\desktop\intro todirectx\introtodirectx\chapter 4\init direct3d\init direct3d.cpp(9) : fatal error C1083: Cannot open include file: 'd3dApp.h': No such file or directory

But clearly from the image shown below, its there

alt text

In oppose to other people who are having issues finding the header on the physical drive. the compiler can not find my header from within the solution explorer.

A: 

Solution view and file view sometimes have no relationship; each file you add to the solution view is an entry in an xml file. The #include directive usually looks at the physical drive location, after looking through include paths.

My suggestion is to add the direct3d.h include path to the project's settings. That's the recommend way as it makes upgrading to newer versions of the SDK painless (and it's a good practise for any external libraries).

Extrakun
ok, but I am having issues with the d3dApp.h . which is a custom made header that I put within the headers folder. They VS automatically created this Header folder for me. so why does it have a hard time finding header files I put in it.
numerical25
A: 
unwind
the header is in the Header folder within the solution explorer. There is no header folder located anywhere near the .sln file on the physical drive. When I go to additional includes, it only allows me to search folders on the physical drive. The Header folder in the picture above only can be found in the .sln
numerical25
+2  A: 

What you see in the left pane of the IDE has absolutely nothing to do with whether the file is there or not there. "Solution Explorer" does not explore the actual files present in the file system, it simply shows you which files are registered as parts of this solution.

In order for the code to compile, the file must be present in the file system of your computer in one of the paths that the specified as search paths for header files of this solution. It is not present, hence the error.

AndreyT
ok, what you said makes alot of sense but I am just a little confused on what to do next. Should I create a folder called Headers and put the header file in it physically. Then add it to the include directories ?? I always thought all files in the solution explorer are physical files embedded into the project.
numerical25
Ok, I added the headers to the root folder where my .sln files and now they can be found.
numerical25

related questions