I have started Computer Graphics using C recently.
below is the code for drawing a line using the 'line' function. I am using Code::Blocks 10.05. I need help with some kind of linker error.
this is what i have done till now.
- installed C::B with all default setting. Then downloaded the lib and include files for graphics from this link.
- added the files to their appropriate folders and followed the instructions.
Here is the code......
#include<stdio.h>
#include<graphics.h>
#include<stdlib.h>
int main()
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
/* initialize graphics mode */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode=graphresult();
if(errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt.");
}
line(0,0,100,100);
closegraph(); // restore the original screen mode.
return 0;
}
Here is the error i am getting.......
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\winbgim.h|378|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ismouseclick'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\winbgim.h|379|error: expected ';', ',' or ')' before '&' token|
||=== Build finished: 2 errors, 0 warnings ===|