• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1254
  • Last Modified:

urgent help

A header file graphics.h has been included in my C program
but i get an error as unable to open the include file
graphics.h.
I had checked in my include dir and the file is available.
I tried by mentioning the entire path
"c:\dirpath\graphics.h"
but no result.
I had used BorlandC version 2.0
I tried to execute in Ms Visual Studio 6.0
When i compile, i get an error in the graphics.h file as

c:\program files\microsoft visual studio\vc98\include\graphics.h(27) : fatal error C1083: Cannot open include file: '_defs.h': No such file or directory

How to rectify this problem.Please help me out.UrgentGive me solutions in both compliers
0
jovita
Asked:
jovita
1 Solution
 
ellesdCommented:
How did you specify the header file.  It can be in <> or "".

If you use <> then the compiler only looks in the standard include directories.  If you use "", it looks in current directory (or directory specified in ""), then the standard directories.  If this is a header file you created, use "".  If not, make sure you are specifying the correct location under the include directory (<dirname/graphics.h>).

0
 
gj62Commented:
Do you have the graphics.h file?

If so, you can copy it to your include directory, or give an explicit path, e.g.

#include "c:\mygraphics\graphics.h"

If you don't have the graphics.h file, you need to find out where it came from and get it, or remove it.  You can try commenting out the include and see what functions or other items are not found...
0
 
ExceterCommented:
>> out where it came from and get it

This would be of little help unless you could get the libraries as well, not to mention the issue of whether or not the library is compatible with your compiler.

Exceter
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
grg99Commented:
First you should find where graphics.h exists.

On Unix you can use the "find" command, start looking in /usr/include and /usr/local/include.

On a PC, use the "DIR /S" or windows search command.

Once you've found the directory, tell your compiler about it with the -I/the/include/dir option.

Good Luck !

0
 
pankajtiwaryCommented:
Since you are including graphics.h, I assume you are using Windows/Dos OS. Now it depends on what is the compiler you are using. If it's turbo C/C++, go to options->Directories. Here put the paths of the include and the lib directories. Then compile.
If you are using Unix, try to locate the file.Then while including give "" instead of <>. And give the full path inside the quotes.
This will certainly compile the code.
0
 
KrypCommented:
Until jovita says which OS supplier and version, and which compiler supplier and version, its just guesswork
0
 
TheBeaverCommented:
The problem here is NOT graphics.h, as the compiler is finding that file. Look at the error....
Its complaining that it can't find _def.h which is mentioned in graphics.h.

This is really a include path issue.

You need to go into MSVC and add the new directory to the include path. This is located in the Directories tab of the project (by memory).

While you can use "" for one file, in this case that one file is refering to others using <>.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
The graphics.h file probably uses some functions of _defs.h, which it includes itself. The _defs.h file is not there in the directory, so you'll need to get it. Probably a problem in your version, I guess. I mean, maybe that your version is not complete. Try re-installing it. Or it maybe that you accidentally moved or deleted the file.

Mayank.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
How about rating it now?
0
 
jmcgOwnerCommented:
Nothing has happened on this question in over 7 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by TheBeaver.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now