0
我一直试图让Allegro5启动并运行在我的Ubuntu机器上。我已编译的代码:Allegro5 - openGL:失败请求的主要操作码:55(X_CreateGC)
#include <stdio.h>
#include <allegro5/allegro.h>
int main(int argc, char **argv)
{
ALLEGRO_DISPLAY *display = NULL;
if (!al_init()) {
fprintf(stderr, "failed to initialize allegro!\n");
return -1;
}
display = al_create_display(640, 480);
if (!display) {
fprintf(stderr, "failed to create display!\n");
return -1;
}
al_clear_to_color(al_map_rgb(0,0,0));
al_flip_display();
al_rest(10.0);
al_destroy_display(display);
return 0;
}
接收此错误:
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 55 (X_CreateGC)
Resource id in failed request: 0x4000002
Serial number of failed request: 25
Current serial number in output stream: 27
尝试这样做的解决方案: http://www.allegro.cc/forums/thread/607530 (变更allegro5.cfg为 “config_selection =旧” 和安装台面utils的)。
我不知道现在该做什么。
我会清除你的生成文件夹并重新开始,确保你已经安装了所有的依赖关系。 (有关详细信息,请参阅http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/Linux/Debian。)它应该在Ubuntu上没有任何问题。 – Matthew
我跑过列表中的所有依赖关系。我是否需要在某处手动添加OpenGL库?或者是否需要在运行./configure之前安装mesa-utils? – Jeff
我不确定你的意思。 Allegro 5不使用'./configure'。如果所有这些依赖关系在使用'cmake'时通过'apt-get'安装,它应该可以工作。 – Matthew