graphic.h not found error

J

Jignesh Danidhar

hi
i am new in c programing i use gcc compiler and i have error graphic.h not found
how can i solve this.
 
S

Siri Cruise

Jignesh Danidhar said:
hi
i am new in c programing i use gcc compiler and i have error graphic.h not
found
how can i solve this.

That's not a standard C header, so it would be implementation specific header.
It looks like maybe a Windows header, so you might get better answers at a
Windows or Microsoft specific newsgroup.
 
J

James Kuyper

hi
i am new in c programing i use gcc compiler and i have error graphic.h not found
how can i solve this.

graphic.h is not a C standard library header, so in general you can't
expect your compiler to know where to look for it. gcc allows you to
specify a command line option, -I pathname, where pathname tells it
where to look.

Of course, that doesn't help if you don't know where the graphic.h is.
What can you tell us about the reason why your code needs to #include
graphic.h? If you're not sure, the simplest way to start the process of
finding out is to remove the #include, and see what lines of code
produce error messages due to its absence.
 
K

Ken Brody

graphic.h is not a C standard library header, so in general you can't
expect your compiler to know where to look for it. gcc allows you to
specify a command line option, -I pathname, where pathname tells it
where to look.

Of course, that doesn't help if you don't know where the graphic.h is.
What can you tell us about the reason why your code needs to #include
graphic.h? If you're not sure, the simplest way to start the process of
finding out is to remove the #include, and see what lines of code
produce error messages due to its absence.

Note that it's quite possible to remove a header file, have the program
compile and link without errors (though perhaps with warnings), and fail to
run because of the missing header.

Ignoring the "let's cast malloc() to get rid of the type mismatch warning"
scenario, what about something as simple as:

fseek(f,0,0);

If sizeof(int)!= sizeof(long), the above will most likely fail at runtime.

(Yes, I know that should really be "SEEK_SET" and not "0" as the 3rd
parameter. But a lot of legacy Unix code looks like the above, though
perhaps with "0L" as the 2nd parameter.)
 
J

James Kuyper

Note that it's quite possible to remove a header file, have the program
compile and link without errors (though perhaps with warnings), and fail to
run because of the missing header.

Ignoring the "let's cast malloc() to get rid of the type mismatch warning"
scenario, what about something as simple as:

fseek(f,0,0);

If sizeof(int)!= sizeof(long), the above will most likely fail at runtime.

(Yes, I know that should really be "SEEK_SET" and not "0" as the 3rd
parameter. But a lot of legacy Unix code looks like the above, though
perhaps with "0L" as the 2nd parameter.)

You're right. It's a very simple first step that can be taken even if
you're thoroughly confused, which stands a decent chance of providing
useful information to help resolve that confusion - but it's not
guaranteed to do so.
 
J

John Gordon

In said:
hi
i am new in c programing i use gcc compiler and i have error
graphic.h not found how can i solve this.

Graphics aren't part of the standard C language. Are you trying to compile
a program you found on the web somewhere, or are you writing your own?
 
K

Keith Thompson

Ken Brody said:
Note that it's quite possible to remove a header file, have the program
compile and link without errors (though perhaps with warnings), and fail to
run because of the missing header.

Ignoring the "let's cast malloc() to get rid of the type mismatch warning"
scenario, what about something as simple as:

fseek(f,0,0);

If sizeof(int)!= sizeof(long), the above will most likely fail at runtime.
[...]

Calling a function with no visible declaration is a constraint violation
as of C99; in principle, that's just as bad as a syntax error.

Unfortunately, a lot of compilers either don't complain about such
things, or don't complain (IMHO) vociferously enough.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top