Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@nayan-Dhpt4N • Aug 28, 2013
There are many reasons as to why the graphics command might not be working. did you include graphics.h in your code. Also can you post which errors you get so that we get a better picture.
-
@shailaja-tiwari-lKhGjd • Aug 28, 2013
here's my code :

-
@nayan-Dhpt4N • Aug 29, 2013
This error seems to be generated due to bad header file. You can try by doing one change here. Change int main() to void main() and remove the return line. I hope this one works. If not, then the header file isnot meant for devcpp. You can try turbocpp
-
@shailaja-tiwari-lKhGjd • Aug 29, 2013
Nayan GoenkaChange int main() to void main() and remove the return line.
I tried it before but it again generates an error as "iostream.h header file not found".So this option doesn't work.
You can try turbocpp
no chance I've already given up with that compiler .π‘π
Isn't there anything else that can be done.I've tried googling but seems of no help.
whereas the earlier header file that I had downloaded throws an error as sstream header file not found .π -
@vishal-pysGmK • Aug 29, 2013
shailaja revathiI tried it before but it again generates an error as "iostream.h header file not found".So this option doesn't work.
no chance I've already given up with that compiler .π‘π
Isn't there anything else that can be done.I've tried googling but seems of no help.
whereas the earlier header file that I had downloaded throws an error as sstream header file not found .πI don't think dev supports graphics.h
however try Downloading the BGI library and try linking with your project.. that might give you some help! -
@shailaja-tiwari-lKhGjd • Aug 29, 2013
Vishal0203I don't think dev supports graphics.h
however try Downloading the BGI library and try linking with your project.. that might give you some help!I've already done that .
-
@nayan-Dhpt4N • Aug 29, 2013
Well it seems all the issues you are facing is basically due to the compiler fault. There is nothing you can do to fix it.
There is a error i just noticed in your code. As i said use the void main()
And correct the first line to.
#include<iostream.h>
The .h seems missing. Maybe it can resolve. If it still doesn't work then you know the answer already, Change compiler, try some other one. -
@shailaja-tiwari-lKhGjd • Aug 30, 2013
Nayan GoenkaWell it seems all the issues you are facing is basically due to the compiler fault. There is nothing you can do to fix it.
There is a error i just noticed in your code. As i said use the void main()
And correct the first line to.
#include<iostream.h>Actually dev-cpp doesn't allow the use of <iostream.h>.It throws an error on using it as 'iostream.h' header file not found .And hence I cannot use void main() as it's not a good programming practice and also not supproted in dev-cpp and most standard versions(I'm using dev-cpp version 5.4.1).
And I'm googling for another compiler meant for graphics functions but you know it's difficult to decide which one would be best ,I'm mean I don't want some outdated old versions ,I wanna try new softwares .Well what is Cygwin ,I mean I know that it provides linux like environnemnt on windows system but is it efficient to be used and please do recommend if you know of some other compiler for Windows 7 32-bit . -
@vishal-pysGmK • Aug 30, 2013
shailaja revathiActually dev-cpp doesn't allow the use of <iostream.h>.It throws an error on using it as 'iostream.h' header file not found .And hence I cannot use void main() as it's not a good programming practice and also not supproted in dev-cpp and most standard versions(I'm using dev-cpp version 5.4.1).
And I'm googling for another compiler meant for graphics functions but you know it's difficult to decide which one would be best ,I'm mean I don't want some outdated old versions ,I wanna try new softwares .Well what is Cygwin ,I mean I know that it provides linux like environnemnt on windows system but is it efficient to be used and please do recommend if you know of some other compiler for Windows 7 32-bit .there is no relation between iostream header and error in declaration of main().
Dev c++ take cares that you don't follow the wrong standards and hence it doesn't allow you to use void main() as it is a bad practice! Use int main() instead! there are reasons behind these things. -
@nayan-Dhpt4N • Aug 30, 2013
Well if you are asking me for a good compiler I would still suggest Turbo C++ which comes in DosBox. It is what I use myself. But I am not a hard core C programmer so it doesn't matter to me directly. I didn't do graphics in C so I dont know much of this. You seem more into C. Good luck in finding a good compiler. What are you trying to build with graphics btw? is it only some testing and exploring or some serious development you are doing.
-
@rahul69-97fAOs • Aug 30, 2013
shailaja revathiI'm using Dev-cpp .Inorder to run graphics command in dev-cpp I included graphics package and bgi files in dev-cpp.But still I'm not able to run graphics command as it throws errors.
Hi thereπ! good to know u are not using turbo C compiler, but then why are u using old bgi library? I would recommend u to use Opengl in DevCpp.
Or if u want to simply use windows and stuff, without drawing lines and rectangles stuff, u can try ur hands on Windows Programming, (It would be a little difficult but adventurous π).
Finally if u still direly wanna do using bgi here is a link I found <#-Link-Snipped-#> hope it helps.
If u want to try another compiler, u can try Visual C++ , its a bit heavier but worth's a shot.
Good Luck Programming!π -
@shailaja-tiwari-lKhGjd • Aug 30, 2013
Vishal0203there is no relation between iostream header and error in declaration of main().
Dev c++ take cares that you don't follow the wrong standards and hence it doesn't allow you to use void main() as it is a bad practice! Use int main() instead! there are reasons behind these things.Actually in Dev-cpp :
#include<iostream>
using namespace std;
So use of main() with return type of int is supported instead of void and hence there is probably a relation with iostream header and main()'s retrun type.
This is what I meant and I'm used to using int main() atleast at home.
Anyway all this stuff I'd learnt from your previous posts in regard to c++ programming tutorials and inspired by that I'm prefering this awesome compiler dev-cpp(atleast better than turbo c).π -
@shailaja-tiwari-lKhGjd • Aug 30, 2013
Nayan GoenkaYou seem more into C. Good luck in finding a good compiler. What are you trying to build with graphics btw?
Actually we have computer graphics practical in c and I don't get enough to learn from turbo-c dos-box in colg due to limited time .Previously I had been using dos-box but it didn't have full screen view and behaved erratically and it seemed a bit tedious to handle it.
[/is it only some testing and exploring or some serious development you are doing.QUOTE]
Only testing and some explorations.no ,only testing and exploring .No opportunity, and time as well, to do some serious development.
-
@shailaja-tiwari-lKhGjd • Aug 30, 2013
rahul69Hi thereπ! good to know u are not using turbo C compiler, but then why are u using old bgi library? I would recommend u to use Opengl in DevCpp.
Or if u want to simply use windows and stuff, without drawing lines and rectangles stuff, u can try ur hands on Windows Programming, (It would be a little difficult but adventurous π).
Finally if u still direly wanna do using bgi here is a link I found <#-Link-Snipped-#> hope it helps.
If u want to try another compiler, u can try Visual C++ , its a bit heavier but worth's a shot.
Good Luck Programming!πThanks for the link it solved some of my problems regarding sstream error.
Will try others also.π -
@vishal-pysGmK • Aug 30, 2013
shailaja revathiThanks for the link it solved some of my problems regarding sstream error.
Will try others also.πI researched on a few things. I think you should go with Code Blocks EP version which has winbgim inbuilt in it...
I tested the code what you have written above!
works fine! -
@vishal-pysGmK • Aug 30, 2013
A copied program!!
executed in code blocks EP
gives the output as the attached image! π
#include <graphics.h> #include <conio.h> int gdriver = DETECT; int gmode; main() { struct fillsettingstype saveset; int pat, clr; initgraph(&gdriver,&gmode,""); for (pat = 1; pat < 12; pat++) { for (clr = 1; clr <16; clr++) { setfillstyle(pat,clr); pieslice(100,100,0,134,49); getch(); } } closegraph(); }
-
@shailaja-tiwari-lKhGjd • Aug 30, 2013
Vishal0203I researched on a few things. I think you should go with Code Blocks EP version which has winbgim inbuilt in it...
I tested the code what you have written above!
works fine!Thanks downloading it now.Will try this too.
-
@rahul69-97fAOs • Aug 30, 2013
shailaja revathiActually we have computer graphics practical in c and I don't get enough to learn from turbo-c dos-box in colg due to limited time .Previously I had been using dos-box but it didn't have full screen view and behaved erratically and it seemed a bit tedious to handle it.
If that's the case , here is an awesome solution to ur problem:
#-Link-Snipped-#
Good Luck! π -
@shailaja-tiwari-lKhGjd • Aug 30, 2013
rahul69If that's the case , here is an awesome solution to ur problem:
#-Link-Snipped-#
Good Luck! πIs it a freeware?
Well I downloaded the software and works the same way as in college,i.e. fullscreen viewing .
Thanks.ππ