'Application using the winbgi library crashes when used with Code::Blocks
I am having trouble when trying to run a graphics program through codeblocks. It just opens console and crashes when I click the build&run button. I have tried many other graphics program the result is still the same. And also I tried to debug it and it says segmentation error. See the picture for more details.
#include <graphics.h>
#include <stdio.h>
#include <conio.h>
int main(void) {
int gdriver = DETECT, gmode;
int x1 = 200, y1 = 200;
int x2 = 300, y2 = 300;
char driver[] = "";
initgraph(&gdriver, &gmode, driver);
line(x1, y1, x2, y2);
getch();
closegraph();
return 0;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

