Questions tagged [bgi]

Borland graphics interface (graphics.h) is a legacy library for 2D graphics similar to nowadays GDI.

Borland graphics interface (graphics.h)

  • is an old legacy library for 2D graphics similar to nowadays
  • was widely used with Borland IDE's like Turbo Pascal or Turbo C++
  • is still used in some schools
392 questions
43
votes
5 answers

Including C headers inside a C++ program

I have a C++ program (.cpp) inside which I wish to use some of the functions which are present inside the C header files such as stdio.h, conio.h, stdlib.h, graphics.h, devices.h etc. I could include the stdio.h library inside my cpp file as :…
Arjun Vasudevan
  • 792
  • 4
  • 13
  • 33
25
votes
5 answers

How can I get and use the header file in my C++ program?

I have been searching to get the source code of the header file and its associated library in order to integrate it with my C++ program. At the same time, I am interested in those cross-platform libraries that works on more than one…
CompilingCyborg
  • 4,760
  • 13
  • 44
  • 61
11
votes
6 answers

How to use graphics.h in codeblocks?

I have recently started learning graphics in C++. I tried #include in my program in codeblocks but it shows error. Then I downloaded graphics.h header from a site and pasted in the include folder in codeblocks, yet it shows…
Jefree Sujit
  • 1,546
  • 5
  • 22
  • 38
10
votes
6 answers

Compiler can't find sstream?

I am trying to compile a program which includes the graphics.h header file for C. I have added the graphics.h and winbgim.h header files in the include folder and also libbgi.a to lib folder. Just for testing, I made a simple hello world program and…
Ayushi Jha
  • 4,003
  • 3
  • 26
  • 43
9
votes
1 answer

Program with graphics being aborted, even though XInitThreads was called

I have just started using Graphics in C, and I encountered this error while running a simple program that draws concentric circles: user@user:~/Documents/C$ gcc circle.c -lX11 -lgraph user@user:~/Documents/C$ ./a.out [xcb] Unknown sequence number…
sobol
  • 191
  • 1
  • 1
  • 7
8
votes
6 answers

BGI error, How to Resolve it?

I want to run a C program that draws a circle. The program is compiling with no error and it is running. After getting the values like radius from the user, I get the error like this : BGI error: Graphics not initialized ( use "initgraph") Even…
sriram
  • 8,562
  • 19
  • 63
  • 82
7
votes
2 answers

Graphics.h c++ undefined reference to various functions like line(),initgraph()

#include #include main() { int gd=DETECT,gm; int i,x,y; initgraph(&gd,&gm,""); line(0,0,640,0); line(0,0,0,480); line(639,0,639,480); line(639,479,0,479); for(i=0;i<=1000;i++) { x=rand()%639; y=rand()%480; …
Adit Jain
  • 151
  • 2
  • 3
  • 6
5
votes
1 answer

graphics.h not working in code blocks with MinGW in windows 7 64bit

I had setup the graphics file necessary for the execution of the graphics code in CodeBlocks from the following sites:- http://www.codewithc.com/how-to-include-graphics-h-in-codeblocks then I tried this sample code. #include int main(…
5
votes
2 answers

Redefinition of int right error using winbgim library

I have a problem with making a program that uses winbgim.h header file. It is a simple program that makes just one simple circle. I am currently learning about winbgim and graphics.h libraries. I downloaded it, I downloaded the library and included…
Adem Dinarević
  • 175
  • 1
  • 4
  • 12
5
votes
2 answers

Linker error in C. while using Turbo C++

I have entered the following code in turbo c++. #include #include int main() { int gd= DETECT, gm; initgraph(&gd,&gm,"D:\\TC\\BGI"); getch(); closegraph(); return 0; } It compiles without…
MELWIN
  • 1,093
  • 4
  • 12
  • 19
4
votes
2 answers

Bresenham's circle algorithm

I have the following code for drawing a circle : #include #include #include #include void main() { int xc, yc, x, y, p[100], r, k; int gdriver=DETECT, gmode, errorcode; printf("\nEnter the center…
sriram
  • 8,562
  • 19
  • 63
  • 82
4
votes
2 answers

draw graph of the function in C graphics

I'm trying to draw a graph of a function. How to do it correctly, i cant find any resources in internet on that. code: #include #include #define G GREEN int main() { int gd = DETECT, gm, angle = 0; double x, y; …
Dpetrov
  • 546
  • 2
  • 5
  • 12
4
votes
2 answers

How can I add graphics.h library on my mac?

I want to draw a rectangle using a C program. So I was trying to use the graphics.h header. But the GCC compiler gave me a error saying that the library could not be found.
Praveen
  • 1,781
  • 6
  • 26
  • 32
4
votes
5 answers

C++ graphics initgraph error (syntax or missing-file flaw?)

[SOLVED] I'm using CodeBlocks (C++) on Win10. I tried to create a simple graphic program - I downloaded a certain graphics package (graphics.h and other two files related to BGI - I added the lib in settings etc.). I tried this program but there…
Mihai Florea
  • 63
  • 1
  • 2
  • 8
4
votes
1 answer

Graphical functions in C

Why I see nothing when I run my code ? I use DOSBox. #include #include #include #include #include #include #include #include int main() { int gdriver = DETECT,gmode…
Denys Shabelnyk
  • 125
  • 2
  • 11
1
2 3
26 27