944,078 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 18692
  • C RSS
Nov 12th, 2005
0

No such file or directory

Expand Post »
  1. #include <conio.h>
  2. #include <graphics.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5.  
  6. void main (int)
  7. {
  8. int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection.
  9. int midx,midy,x;
  10. //Initializing graphics and local variables.
  11. initgraph(&gdriver,&gmode,"d:\\bc3\\bgi");
  12. //Reading result of initialization.
  13. errorcode=graphresult();
  14. if(errorcode!=grOk)
  15. //An error occurred.
  16. {
  17. printf("Graphics error occurred : %s \n",grapherrormsg(errorcode));
  18. printf("Press any key to stop : ");
  19. getch();
  20. exit(1); //Terminate the program due to error.
  21. }
  22. /*Changing the foreground color.
  23. Note : Press enter to exit the last screen as it is black and
  24. it may appear as if the program has stopped running.*/
  25. for(x=15;x>=0;x--)
  26. {
  27. setcolor(x);
  28. circle(20+(x*40),200,15);/*Changing x-coordinate by 50 each time so that
  29. the circles do not overlap.*/
  30. getch();
  31. }
  32. cleardevice(); //Clearing the screen in the graphics mode.
  33. circle(200,200,50);
  34. getch();
  35. closegraph();
  36. }

i have one erorr
fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
Error executing cl.exe.

please help
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
some one is offline Offline
129 posts
since Apr 2005
Nov 12th, 2005
0

Re: No such file or directory

Looks like you dont have it given by the Visual C++ Compiler. Some old versions of Borland had it. But I dont think not now.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Nov 12th, 2005
0

Re: No such file or directory

graphics.h was non-standard 16-bit Borland compiler specific. M$ compilers never supported it. You will probably have to download free copy of Turco C to compile that program.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,957 posts
since Aug 2005
Nov 12th, 2005
0

Re: No such file or directory

thanks you mean that i can not use this library
would you give me another one please
Reputation Points: 10
Solved Threads: 0
Junior Poster
some one is offline Offline
129 posts
since Apr 2005
Nov 12th, 2005
0

Re: No such file or directory

Quote originally posted by some one ...
thanks you mean that i can not use this library
would you give me another one please
The days of directly accressing windows memory are gone! For MS-Windows, there is OpenGL which I think is free, DirectX and DirectDraw, both free from Microsoft. All are very complex libraries.

you can also call win32 api functions to draw graphics. I think you can find several tutorials if you google for them.

There is also QT, which is a os-independent way of going graphics. Free for home use, but not free for commercial use.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,957 posts
since Aug 2005
Nov 13th, 2005
0

Re: No such file or directory

sorry but i do not know how to make what you say
i want this program to design my program which written in c++ language
Reputation Points: 10
Solved Threads: 0
Junior Poster
some one is offline Offline
129 posts
since Apr 2005
Nov 13th, 2005
0

Re: No such file or directory

Quote originally posted by some one ...
sorry but i do not know how to make what you say
i want this program to design my program which written in c++ language
everything I mentioned can be used by C++. Its just that they are all somewhat difficult to use and will require a solid understanding of c++ language, not really intended for newbes :rolleyes: Afterall you can't play a Beethovan's Concertos if you know nothing about music, so what makes you think you can write complicated graphics programs with no (or little) knowledge of a programming language?
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,957 posts
since Aug 2005
Nov 13th, 2005
0

Re: No such file or directory

thanks for encarge me however i am just a biggener am not aprofissional i try hard to teach my self
any way thank you very very much
Reputation Points: 10
Solved Threads: 0
Junior Poster
some one is offline Offline
129 posts
since Apr 2005
Nov 7th, 2009
-2
Re: No such file or directory
Click to Expand / Collapse  Quote originally posted by some one ...
  1. #include <conio.h>
  2. #include <graphics.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5.  
  6. void main (int)
  7. {
  8. int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection.
  9. int midx,midy,x;
  10. //Initializing graphics and local variables.
  11. initgraph(&gdriver,&gmode,"d:\\bc3\\bgi");
  12. //Reading result of initialization.
  13. errorcode=graphresult();
  14. if(errorcode!=grOk)
  15. //An error occurred.
  16. {
  17. printf("Graphics error occurred : %s \n",grapherrormsg(errorcode));
  18. printf("Press any key to stop : ");
  19. getch();
  20. exit(1); //Terminate the program due to error.
  21. }
  22. /*Changing the foreground color.
  23. Note : Press enter to exit the last screen as it is black and
  24. it may appear as if the program has stopped running.*/
  25. for(x=15;x>=0;x--)
  26. {
  27. setcolor(x);
  28. circle(20+(x*40),200,15);/*Changing x-coordinate by 50 each time so that
  29. the circles do not overlap.*/
  30. getch();
  31. }
  32. cleardevice(); //Clearing the screen in the graphics mode.
  33. circle(200,200,50);
  34. getch();
  35. closegraph();
  36. }

i have one erorr
fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
Error executing cl.exe.

please help
how can we remove the error-no such file or directory for graphics.h.plz help me
Reputation Points: 9
Solved Threads: 0
Newbie Poster
jyotijain1985 is offline Offline
1 posts
since Nov 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Prime numbers from 1 to 100
Next Thread in C Forum Timeline: Problem with Bitwise Masking





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC