开发者

Linker can't find initgraph() and closegraph()?

开发者 https://www.devze.com 2023-01-09 23:02 出处:网络
The linker gives error that overflow at initgraph and close graph #include<dos.h> #define DETECT 0

The linker gives error that overflow at initgraph and close graph

#include<dos.h>
#define DETECT 0
union REGS in,out;
void detectmouse()//no declaration(prototype)?
{
    in.x.ax=0;
    int86(0x33,&in,&out);
    if(out开发者_开发百科.x.ax==0)
    {
        printf("Fail to initialize the mouse.");
    }
    else
    {
    printf("Mouse succesfully initialized.");
    }
    getch();
}

void showmousegraphics()//show mouse in graphics mode
{
    int driver=DETECT,mode;
    initgraph(&driver,&mode,"c:\\tc\\bgi");
    in.x.ax=1;
    int86(0X33,&in,&out);
    getch();
    closegraph();
}
void main()
{
    detectmouse();
    showmousegraphics();

}


Ahh, you're probably using some old compiler for DOS. In that case, you have to choose large memory model when compiling, so that you can have more than 64kB of code.

0

精彩评论

暂无评论...
验证码 换一张
取 消