Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

graphic.h not found error

36 views
Skip to first unread message

Jignesh Danidhar

unread,
Apr 18, 2013, 12:04:27 AM4/18/13
to
hi
i am new in c programing i use gcc compiler and i have error graphic.h not found
how can i solve this.

Siri Cruise

unread,
Apr 18, 2013, 12:54:00 AM4/18/13
to
In article <00c8a198-6e71-48c0...@googlegroups.com>,
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.
--
Daddy says Mormons are all programmers because their god is Cobol. Should
I ask Mormons to reschedule Bullwinkle?
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted.

James Kuyper

unread,
Apr 18, 2013, 8:04:39 AM4/18/13
to
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.
--
James Kuyper

Ken Brody

unread,
Apr 18, 2013, 9:01:54 AM4/18/13
to
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.)

James Kuyper

unread,
Apr 18, 2013, 9:09:29 AM4/18/13
to
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.
--
James Kuyper

John Gordon

unread,
Apr 18, 2013, 10:08:23 AM4/18/13
to
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?

--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

Keith Thompson

unread,
Apr 18, 2013, 11:21:33 AM4/18/13
to
Ken Brody <kenb...@spamcop.net> writes:
[...]
> 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.

--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
0 new messages