Problema usando o graphics.h no Ubuntu

0
# include<stdio.h>
# include<graphics.h>
# include<math.h>
using namespace std;
int main(void)
{
    int gd=DETECT,gm;
    int r,x,y,p,xc=320,yc=240;

    initgraph(&gd,&gm,NULL);
    cleardevice();


    printf("Enter the radius ");
    scanf("%d",&r);


    x=0;
    y=r;
    putpixel(xc+x,yc-y,1);

    p=3-(2*r);

    for(x=0;x<=y;x++)
    {
        if (p<0)
        {
             y=y;
            p=(p+(4*x)+6);
        }
        else
        {
            y=y-1;

            p=p+((4*(x-y)+10));
        }

    putpixel(xc+x,yc-y,1);
    putpixel(xc-x,yc-y,2);
    putpixel(xc+x,yc+y,3);
    putpixel(xc-x,yc+y,4);
    putpixel(xc+y,yc-x,5);
    putpixel(xc-y,yc-x,6);
    putpixel(xc+y,yc+x,7);
    putpixel(xc-y,yc+x,8);

    }
    getch();
    closegraph();
}
  • graphics.h
  • instalados
  • compilado usando gcc filename.cpp -0 filename -lgraph
  • então usado ./filename
  • a janela é exibida por 10 segundos e o erro abaixo aparece:
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
heart: ../../src/xcb_io.c:273: poll_for_event: Assertion '!xcb_xlib_threads_sequence_lost' failed.
Aborted

Alguma solução?

    
por blooooomer 05.03.2012 / 18:35

1 resposta

1

Existe um bug arquivado no Launchpad muito semelhante ao problema acima .

Uma mensagem contém uma citação do detalhamento da fonte quando esta condição de erro ocorre:

% bl0ck_qu0te%     
por lgarzo 05.03.2012 / 19:06