Cannot open header file

Hi all,

I am trying to build a project in VC++, but most of the time I keep getting the following error:

Cannot open include file: 'xyz.h': No such file or directory, where xyz is the header file which the programs are calling..

I have made sure to include that header file using project->add existing item.
I also manually put the header file in the main project folder..
but still... it's giving the same error..

The code uses "xyz.h" format.. is this a problem?? coz even changing it to <xyz.h> doesn't help..

Many thanks,

Abhi
The header has to be in the same directory as the file that's including it for #include "xyz.h" . For #include <xyz.h> to work, the file has to be in one of the compiler header search paths.
Projects are tricky, you probably have the header file saved somewhere on your computer, desktop for example, and when you added existing item you added it from there. So if you don't have your main file that you are trying to include your header file in on your desktop or in the same folder as your header file it isn't going to work.

Suggestion, make a new folder, put all your files in the same directory and then add the items.

Also what helios said, if you haven't done so, make sure to put #include "xyz.h"
Topic archived. No new replies allowed.