B
BattleMage
Здравствуйте, товарищи. Доброго времени суток!
У меня возникла такая проблема: как вообще пользоваться графикой в Си под ДОСом (Borland C++ 3.1)
библиотеку graphics.h включать умею![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
Скопировал прогу из хелпа стандартного, но она не пашет.
Ошибки такие:
undefined symbol _closegraph() in module ...\BAR.cpp
undefined symbol _bar() in module ...\BAR.cpp
undefined symbol _grapherrormsg() in module ...\BAR.cpp
и так далее...
Текст проги такой:
Папку BGI скопировал в папку с прогой (bar.cpp)
У меня возникла такая проблема: как вообще пользоваться графикой в Си под ДОСом (Borland C++ 3.1)
библиотеку graphics.h включать умею
![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
Скопировал прогу из хелпа стандартного, но она не пашет.
Ошибки такие:
undefined symbol _closegraph() in module ...\BAR.cpp
undefined symbol _bar() in module ...\BAR.cpp
undefined symbol _grapherrormsg() in module ...\BAR.cpp
и так далее...
Текст проги такой:
Код:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
void main()
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy, i;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
/* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
return;
/* terminate with an error code */
}
midx=320;
midy=240;
// midx = getmaxx() / 2;
// midy = getmaxy() / 2;
/* loop through the fill patterns */
for (i=SOLID_FILL; i<USER_FILL; i++)
{
/* set the fill style */
// setfillstyle(i, getmaxcolor());
/* draw the bar */
bar(midx-50, midy-50, midx+50, midy+50);
getch();
}
/* clean up */
closegraph();
return;
}
Папку BGI скопировал в папку с прогой (bar.cpp)