Sunday, August 2, 2009

Problem w/ BGI in C programs?

my program works with the C compiler but doesnt work after it is compiled.


if you run it w/ command prompt, it says "BGI Error: Graphics not initialized (use initgraph)"

Problem w/ BGI in C programs?
You need to call initgraph() as the first BGI function. You also need to link to your program graphics library and install some BGI driver from your code or convert BGI driver(s) to .obj file(s) for further linkage to your program.


Read TC++ help: it contains code examples.
Reply:Have you tried initializing the graphics using initgraph()? A compiler can only detect syntactical errors such as misusing variables or not provide the correct arguments for a function. It has no way of determining if you are logically doing something in the wrong order. This is why humans are still the best programmers.

kudzu

No comments:

Post a Comment