Friday 19 August 2011

Run Graphics programs in Dev C++

Many people uses Turbo c++ to run c and c++ programs. More people want to do graphics programs.If they use windows 7 64 bit they may not be able to run Turbo c++. Dev C++ is more user friendly .Here you can see how to run graphics programs in Dev C++.

Steps

1: Download graphics.h

2:Download libbgia

Download this from here .

3:Copy the graphics.h file and go to the directory C\ Dev-Cpp\include

4:paste it

5:Copy libbgia and go to C\Dev-cpp\lib

6: paste it there

7:Open Dev Cpp

8: Go to file--> New--> project

9: Go to project menu ,select project options

10: Select parameters

11: Copy the following code in the Linker field.

-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
 
11:Save this project file for future use else you should again copy the above code 
in the linker field.
 
Sample C program to draw a circle 
 
#include<stdio.h>
#include<graphics.h>
int main()
{
       initwindow(400, 300, "First Sample");
    circle(150,150,50);
getch();
}
 
Note : You can download Dev-C++ from here

7 comments:

This all is ok : thanx:
but please tell me how to run a simple programe or function with graphics programe please post it
i will wait for your rep if u can please do it:

Sorry for late replay.I can't understand your doubt completely. Above example explains how to run graphics programs in Dev C++(note it). Programs are similar to that in Turbo C++(also similar built in graphics functions).But you should define the window Ex: (note 400, 300 are arbitrary)
initwindow(400, 300, "First Sample");
(not needed in Turbo C++).

Check my previous sample graphics programs like helicopter,fan analog clock etc

man it doesnt work.....giving errors in graphics.h file

oh thanx budyy but we cant run simple programe in bgi windows i try it alot but i cant; anyhow thanx alot

hey buddy.. i wanted to know.. that using these library or etc. can we make the use of colours in c++ , i mean we look all the softwares around us , mostly coded in c++ , i mean how.. can we actually fill all that moving graphics , colours , pics. etc. whil coding with c++ ?

you can easily access graphics in windows 8 by installing CodeBlocks………!
just go to google -> type -> codeblocks -> and go to this site and download -

http://sourceforge.net/projects/codeblocks/……………..!

I hope this will help you all thanks…………..!

Check out the following link which illustrates easy way to run graphics program in Dev-C++

http://emahbub.blogspot.com/2015/03/how-to-write-c-graphics-program-in-dev-c_56.html

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More