私は Allegro 5.0.8 でゲームを開発していますが、コンパイルして Linux (Mint 14) で実行するまではすべてうまくいっていました。
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
#include <iostream>
int main(void)
{
al_init();
ALLEGRO_DISPLAY *screen = al_create_display(800, 600);
al_init_image_addon();
ALLEGRO_PATH *path = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
al_set_path_filename(path, "players.png");
ALLEGRO_BITMAP *img = al_load_bitmap(al_path_cstr(path, '/'));
if (img == NULL)
std::cout << al_path_cstr(path, '/') << std::endl;
al_draw_bitmap(img, 0, 0, 0);
al_flip_display();
while (true){}
return 0;
}
この例は問題なくコンパイルされますが、次の行
ALLEGRO_BITMAP *img = al_load_bitmap(al_path_cstr(path, '/'));
NULLを返します。一方、ライン
std::cout << al_path_cstr(path, '/') << std::endl;
画像の正確な絶対パスを出力します。
私は何を間違っていますか?