Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

#include<graphics.h>=>GRESKA!!

[es] :: C/C++ programiranje :: C/C++ za početnike :: #include<graphics.h>=>GRESKA!!

[ Pregleda: 2366 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

bratovuk
Belgrade

Član broj: 134201
Poruke: 95
*.adsl-1.sezampro.yu.



Profil

icon #include<graphics.h>=>GRESKA!!11.04.2008. u 01:35 - pre 195 meseci
Koristim MVS6.0

zasto mi compiler izbacuje: fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
Error executing cl.exe.


za ovaj kod:

Code:
 #include <conio.h>
 #include<graphics.h>    //OVDE je error, zasto?
 #include <stdio.h>
 #include<process.h>
 #include<dos.h>
static int mx,my,click;
union REGS regs,regs1;
void intro();
void getmouse();
void mousepos();
void points();
void main(void)
{
    int a=DETECT,b,c,x,y,x1,y1,s=50,x2=200,y2=300,p=0,p1=0;
    initgraph(&a,&b,"");
    x=x1=getmaxx()/2;
    y=y1=getmaxy()/2;
    settextstyle(3,0,6);
    outtextxy(330,40,"RULES");
    settextstyle(3,1,2);
    outtextxy(10,100,"PLAYER 2      PLAYER 1");
    settextstyle(1,0,1);
    outtextxy(40,120,"Keyboard player should touch the big circle of mouse");
    settextstyle(1,0,1);
    outtextxy(40,140,"and should escape from the small cirle of the mouse ");
    settextstyle(1,0,1);
    outtextxy(40,160,"player using arrows ");
    settextstyle(1,0,1);
    outtextxy(40,280,"Mouse player should touch the keyboard circle with the ");
    settextstyle(1,0,1);
    outtextxy(40,300,"small circle above the screen using left click, right click");
    settextstyle(1,0,1);
    outtextxy(40,320,"and both clicks to bring the circle down saving the big circle ");
    getch();
    cleardevice();
    settextstyle(2,0,6);
    outtextxy(200,100,"target score 200");
    getch();
    for(;;)
    {
         getmouse();
         mousepos();
         circle(x2,y2,20);
         while(kbhit())
             c=getch();
         cleardevice();
         setcolor(2);
         circle(x,y,40);
         setlinestyle(1,2,3);
         setcolor(2);
         line(x1,y1,x,y);
         setcolor(14);
         gotoxy(3,30);
         printf("points of keyboard player  are %d  points of mouse player 1 are %d",p,p1);
         setlinestyle(5,6,70);
         rectangle(20,20,getmaxx()-20,getmaxy()-20);
         circle(mx,my,65);
         if(p1>=200)
         {
            clearviewport();
            settextstyle(1,0,5);
            outtextxy(100,200,"mouse player wins");
            delay(2000);
            getch();
            exit(2);
         }
            if(p>=200)
            {
                  cleardevice();
                  settextstyle(1,0,5);
                  outtextxy(100,200,"keyboard player wins");
                  delay(2000);
                  getch();
                  exit(2);
            }
            if(mx<x+105&&mx>x-105&&my<y+105&&my>y-105)
            {
                p+=10;
                delay(500);
                points();
            }
            if(x2<x+45&&x2>x-45&&y2<y+45&&y2>y-45)
            {
                p1+=10;
                delay(500);
                points();
            }
            if(c==77) //>
            {
                if(x<getmaxx()-90)
                x+=s;
            }
            if(c==72) //^
            {
                if(y>90)
                y-=s;
             }
             if(c==75) //<
             {
                if(x>80)
                 x-=s;
             }
             if(c==80) //v
             {
                if(y<getmaxy()-90)
                y+=s;
             }
             if(c==77&&c==80) // >  v
             {
             if(x<getmaxy()-40)
             x+=s;
             if(y<getmaxy()-40)
             y+=s;
             }
             if(c==72&&c==75) //^   <
             {
             if(y>40)
             y-=s;
             if(x>40)
             x-=s;
             }
             if(c==75&&c==80) //<   v
             {
             if(x>40)
             x-=s;
             if(y<getmaxy()-40)
             y+=s;
             }
             if(c==80&&c==75) //v   <
             {
             if(y<getmaxy()-40)
             y+=s;
             if(x>20)
             x-=s;
             }
             if(click==2) //>       right
             {
             if(x2<getmaxx()-40)
             x2+=s;
             }
             if(click==0) //^      no click
             {
             if(y2>40)
             y2-=s;
             }
             if(click==1) //<       left
             {
             if(x2>40)
             x2-=s;
             }
             if(click==3) //v       both
             {
             if(y2<getmaxy()-40)
             y2+=s;
             }
     }
}
void getmouse()
{
    int86(51,&regs,&regs1);
    regs.x.ax=1;
}
void mousepos()
{
    regs.x.ax=3;
    int86(51,&regs,&regs1);
    click=regs1.x.bx;
    mx=regs1.x.cx;
    my=regs1.x.dx;

}
void points()
{
      settextstyle(3,0,12);
      outtextxy(100,200,"+ 10");
}
 
Odgovor na temu

X Files
Vladimir Stefanovic
Pozarevac

SuperModerator
Član broj: 15100
Poruke: 4902
*.tekostolac.co.yu.

Jabber: xfiles@elitesecurity.org


+638 Profil

icon Re: #include<graphics.h>=>GRESKA!!11.04.2008. u 06:47 - pre 195 meseci
Bilo je već reči na ovu temu.

Ako se ne varam, graphics.h je stara Borlandova biblioteka, koju M$ kompajleri nikada nisu uključivali.

Najlakše ti je da skineš sa neta Turbo C za DOS da bi kompajlirao taj program.
 
Odgovor na temu

bratovuk
Belgrade

Član broj: 134201
Poruke: 95
*.adsl-a-1.sezampro.yu.



Profil

icon Re: #include<graphics.h>=>GRESKA!!11.04.2008. u 23:02 - pre 195 meseci
tnx!
 
Odgovor na temu

mixerowsky
Miroslav Mitic
Donja Lomnica

Član broj: 174629
Poruke: 42
*.dynamic.adsl.itsisp.net.



Profil

icon Re: #include<graphics.h>=>GRESKA!!12.04.2008. u 14:17 - pre 195 meseci
tacno je da je to stara borlandova datoteka, ja sam se pomucio dok sam nasao tu biblioteku....iz Turbo C 1.0 (mislim da je taj) kopirao sam tu biblioteku u Turbo C 2.01 kako bi sve to radilo...
 
Odgovor na temu

[es] :: C/C++ programiranje :: C/C++ za početnike :: #include<graphics.h>=>GRESKA!!

[ Pregleda: 2366 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.