?
Solved

urgent help

Posted on 2003-02-20
11
Medium Priority
?
1,243 Views
Last Modified: 2007-12-19
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
Comment
Question by:jovita
[X]
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
11 Comments
 
LVL 2

Expert Comment

by:ellesd
ID: 7988007
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
 
LVL 6

Expert Comment

by:gj62
ID: 7988070
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
 
LVL 8

Expert Comment

by:Exceter
ID: 7988297
>> 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
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!

 
LVL 22

Expert Comment

by:grg99
ID: 7989746
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
 
LVL 4

Expert Comment

by:pankajtiwary
ID: 7991778
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
 
LVL 2

Expert Comment

by:Kryp
ID: 7992425
Until jovita says which OS supplier and version, and which compiler supplier and version, its just guesswork
0
 
LVL 1

Accepted Solution

by:
TheBeaver earned 200 total points
ID: 7996772
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 8101212
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 8544812
How about rating it now?
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10011003
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

777 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