fatal error C1083

I'm trying to compile this code I got from someone.
I keep on getting "fatal error C1083: Cannot open include file: 'xxx.h': No such file or directory" (where xxx.h is the name of the file).
The file xxx.h exists in the project, but I guess the file that has the include "xxx.h" can't find it.
What can be wrong? What should I check?

Who is Participating?
nonubikConnect With a Mentor Commented:
Project --> Settings -> c/c++ -> Category 'preprocessor' -> 'Additional include directories' field

Make sure the directory where the .h file is is on the 'include path'. This'll probably be somewhere in the project options for your application. Depends upon the platform.
chayahd99Author Commented:
I'm using Visual C++.
I can't find in Project --> Settings where to define this.
Besides, why should I need to define it manualy? Isn't the 'include' statment enough ?
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Sorry - haven't VC++ installed, and can't remember exactly where it is. (It's reasonably obvious, through!)

The #include is fine if you include the full directory of the file. Otherwise it needs to know where to go looking on your drive!
You have 3 possibilities

You can place the complete path to the file, something like.....

#include "c:\development\myProj\Include\xxx.h"

2) If the include directory is a directory where include files from all projects can be included

you can do

Tools -> Options -> Projects -> VC++ Directories -> Include files and add the directory there.

3) you can do nonubik suggestion.
Suggestion number 2 would be the same as using number 3 for every project you use in Visual Studio......

Hope this helps


chayahd99Author Commented:
Thanks nonubik.
I followed the steps you wrote & saw that the directory which containes the h file is written properly, together with other paths.
What else can it be ?
Try the suggestions I posted

Let's take the MSDN explanations, step by step. Could be one of:

-File, subdirectory, or disk is read-only.
-No access permission for file or directory. (not likely)
-Not enough file handles. Close some applications and recompile. (not likely at all)
-An #include directive uses double quotation marks around a path specification, which causes the standard directories to be skipped.
Jaime OlivaresSoftware ArchitectCommented:
Are directories in your settings separated by commas or other sign?
chayahd99Author Commented:
nonubik's solution is basicly what I needed to do, but for a different file.


file b includes file a.
file c include file  b.

in the code & settings for file b, file a was marked as an include file.
in the code & settings for file c, file b was marked as an include file.

I added to the settings of file c an include to file a & that solved the problem.
I'm not sure why this is required, but it worked.

I'll be glad to get an explanation.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.