Member • Aug 28, 2013
-
Shailaja TiwariI'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.
-
Member • 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.Are you sure? This action cannot be undone. -
Member • Aug 28, 2013
here's my code :
Are you sure? This action cannot be undone. -
Member • 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 turbocppAre you sure? This action cannot be undone. -
Member • Aug 29, 2013
I tried it before but it again generates an error as "iostream.h header file not found".So this option doesn't work.Nayan GoenkaChange int main() to void main() and remove the return line.
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 .😔Are you sure? This action cannot be undone. -
Member • Aug 29, 2013
I don't think dev supports graphics.hshailaja 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 .😔
however try Downloading the BGI library and try linking with your project.. that might give you some help!Are you sure? This action cannot be undone. -
Member • Aug 29, 2013
I've already done that .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!Are you sure? This action cannot be undone. -
Member • 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.Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
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).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>
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 .Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
there is no relation between iostream header and error in declaration of main().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 .
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.Are you sure? This action cannot be undone. -
Member • 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.Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
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.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.
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!👍Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
Actually in Dev-cpp :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.
#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).😛Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
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.Nayan GoenkaYou 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.QUOTE]
no ,only testing and exploring .No opportunity, and time as well, to do some serious development.
Only testing and some explorations.Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
Thanks for the link it solved some of my problems regarding sstream error.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!👍
Will try others also.😀Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
I researched on a few things. I think you should go with Code Blocks EP version which has winbgim inbuilt in it...shailaja revathiThanks for the link it solved some of my problems regarding sstream error.
Will try others also.😀
I tested the code what you have written above!
works fine!Are you sure? This action cannot be undone. -
Member • 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(); }
Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
Thanks downloading it now.Will try this too.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!Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
If that's the case , here is an awesome solution to ur problem: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.
#-Link-Snipped-#
Good Luck! 😀Are you sure? This action cannot be undone. -
Member • Aug 30, 2013
Is it a freeware?rahul69If that's the case , here is an awesome solution to ur problem:
#-Link-Snipped-#
Good Luck! 😀
Well I downloaded the software and works the same way as in college,i.e. fullscreen viewing .
Thanks.😀😁Are you sure? This action cannot be undone.