|
아시는 분 계시면 도움을 청합니다.
볼랜드 4.5를 쓰고 있습니다.
터보 C++3.0에서는 그래픽함수를 써도
에러없이 뜨는 프로그램이
볼랜드 C++4.5에서는 에러가 뜹니다.
컴파일시
BGI graphics not supported under Windows
라는 메세지가 뜨면서 에러가 나요.
제가 짠 프로그램에 이상이 있는건지
아님 터보C++3.0에서와 같이
option-Linker-libraries에서
graphic library를 체크해주는 것과 같이
볼랜드에서 옵션설정을 잘 못했는지
알수가 없어서 이렇게 글을 올립니다.
제가 돌려본 프로그램은 이것입니다.
이걸로 돌려보시고 에러가 뜨실겁니다.
답변을 부탁드립니다.
#include<Graphics.h>
#include<conio.h>
#include<stdlib.h>
float x,y;
int i,j;
char *k;
void main()
{
while(1){
int graphdriver=DETECT,graphmode;
initgraph(&graphdriver,&graphmode,"C:\\bc45\\bgi");
printf("스텝수를 입력하세요:");
scanf("%s",k);
if ((0 == strcmp(k, "q"))||(0 == strcmp(k,"Q"))){
closegraph();
exit(0);
}
i=atoi(k);
cleardevice();
x=getmaxx(); y=getmaxy();
for(j=1;j<=i-1;j++){
setcolor(j%15);
line((i-j)*x/i,0,0,j*y/i);
line(0,j*y/i,j*x/i,y);
line(j*x/i,y,x,(i-j)*y/i);
line(x,(i-j)*y/i,(i-j)*x/i,0);
}
getch();
cleardevice();
closegraph();
}
exit(1);
}
|