shabeeb ahamed
shabeeb ahamed

Reputation:

Error when compiling c-graphics in a Turbo C++ program

In my Turbo C++ program, I can't run any of the graphics program. When it compiles, it shows an error like:

undefined symbol _line, _closegraph,_ getmaxx etc...

Is it due to the settings of my c-program?

Upvotes: 2

Views: 1726

Answers (4)

Shourya Pratap Singh
Shourya Pratap Singh

Reputation: 11

If the problem is of compiling error then you may add the header file:

#include<graphics.h>

if the problem still persists then make sure you have added the header file:

#include<dos.h>

Upvotes: 0

unwind
unwind

Reputation: 400039

Is this an old program that was written for Turbo C++, and that you're trying to compile with a modern compiler? If so, it might be the case that the program uses compiler-specific extensions and libraries, that are simply not available in the compiler you're using now.

If that is the case, you must either

  • find an existing library for your current environment that emulates the old Turbo C++ one, or
  • find out exactly what each call is supposed to do, and change the code to use something that your environment supports.

Upvotes: 3

Real Red.
Real Red.

Reputation: 5039

It's compile error and not link error. Looks like "graphics.h" is missing.

Do

#include "graphics.h"

Upvotes: 1

user36457
user36457

Reputation:

Those errors are typical of a missing library in your build. Try linking the appropriate libraries and rebuild the solution (most likely graphics.lib).

-John

Upvotes: 0

Related Questions