[c++] fatal error C1083: Cannot open include file: 'xyz.h': No such file or directory?

I am using visual studio 2005 to create a project. And I have folder structure in project as: a folder called code. this folder contains all *.cxx files.

Now, I have created a class xyz in header file xyz.h. And defined every thing in xyz.cxx which is placed in code folder. But now when I try to compile it with visual studio it throws me an error "fatal error C1083: Cannot open include file: 'xyz.h': No such file or directory". how to rectify this problem.

This question is related to c++

The answer is


Add the "code" folder to the project properties within Visual Studio

Project->Properties->Configuration Properties->C/C++->Additional Include Directories


This problem can be easily solved by installing the following Individual components:

enter image description here


The following approach helped me.

Steps :

1.Go to the corresponding directory where the header file that is missing is located. (In my case,../include/unicode/coll.h was missing) and copy the directory location where the header file is located.(Copy till the include directory.)

2.Right click on your project in the Solution Explorer->Properties->Configuration Properties->VC++ Directories->Include Directories. Paste the copied path here.

3.This solved my problem.I hope this helps !


I ran into this error in a different situation, posting the resolution for those arriving via search: from within Visual Studio, I had copied a file from one project and pasted into another. Turns out that creates a symbolic link, not an actual copy. Thus the project did not find the file in the current working directory as expected. When I made a physical copy instead, in Windows Explorer, suddenly #include "myfile.h" worked.