fatal error C1083

Posted on 2004-08-03
Last Modified: 2010-08-05
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?

Question by:chayahd99
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
LVL 12

Expert Comment

ID: 11703175

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.

Author Comment

ID: 11703232
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 ?
LVL 12

Expert Comment

ID: 11703308
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!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 16

Accepted Solution

nonubik earned 50 total points
ID: 11703416
Project --> Settings -> c/c++ -> Category 'preprocessor' -> 'Additional include directories' field

Expert Comment

ID: 11704706
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



Author Comment

ID: 11704710
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 ?

Expert Comment

ID: 11704794
Try the suggestions I posted

LVL 16

Expert Comment

ID: 11705133
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.
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11705433
Are directories in your settings separated by commas or other sign?

Author Comment

ID: 11713790
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.

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question