c++cturbo-c++bgi

Using Turbo C++, how I can draw graphics in C?


I've started work on computer graphics. I am using Turbo C++ 3.0 as my IDE on Windows 7. The problem I am facing is that it doesn't show me any compile time error if it compiles it from Turbo C++. When I execute its EXE file, it doesn't draw any circle on the screen. It shows me the following error (compile time) if I compile it from a command prompt.

I've installed DOSBox, but it also gives me the same errors. The error I am getting is:

Undefined symbol _circle in module conc.c

Here is my code.

#include <stdio.h>
#include <graphics.h>
void main()
{
    int x, y, r;
    int gd = DETECT ,gm;
    initgraph(&gd, &gm, "C:\\TC\\BGI");
    setcolor(3);
    circle(250, 200, 60);
}

Solution

  • As I can see there isn't any fault in your C code. You're probably lacking some knowledge about your IDE (Turbo C++). Turbo C++ 3.0 on Windows 7 is really unimaginable. However, if you want to do this you should set your environment of Turbo C++. Take these simple steps:

    Since you are using it on Windows 7, it won't support full screen mode you should disable it. To do so, go to Environment and set source tracking to 'Current Window', which has a radio button swap it with 'New Window'.


    For fullscreen mode support, you can download DOSBOX app. It can even run your old DOS applications.

    For this you have to install DOSBOX and you need to mount your working directory.