我已经用MinGW 4.5.2设置了Allegro 5.0.4,并且正在使用带有Code::Blocks的GUN GCC编译器。
当我尝试编译时:
#include <stdio.h>
#define ALLEGRO_STATICLINK
#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;
}
我收到以下构建错误。
建立讯息:
C:\i\liballegro-5.0.4-static-mt-debug.a(wsystem.o)
In function "al_win_safe_load_library":
d:\Libraries\build\allegro\src\allegro-5.0.x\allegro-5.0.x\src\win\wsystem.c
629 undefined reference to "PathFindOnPathA@8"
=== Build finished: 1 errors, 0 warnings ===
最佳答案
看到这个:
即:将该库添加到链接库列表中。