I downloaded allegro-4.4.3.1 and I am trying to load bmp file via load_bitmap():
#SelectExpand
1#include <allegro.h>
2#include <stdio.h>
3int main
(void)
4{
5 BITMAP* b
= load_bitmap("/home/ibse/alexlogo.bmp", NULL
);
6 return 0;
7}
but get Segmentation fault error. The backtrace is
#SelectExpand
1Program terminated with
signal SIGSEGV, Segmentation fault.
2#0 0x00007f6b7472c204 in create_bitmap_ex (color_depth=8, width=128, height=128) at /home/ibse/Downloads/allegro-4.4.3.1/src/graphics.c:1042
31042 if (system_driver->create_bitmap
)
4(gdb
) bt
5#0 0x00007f6b7472c204 in create_bitmap_ex (color_depth=8, width=128, height=128) at /home/ibse/Downloads/allegro-4.4.3.1/src/graphics.c:1042
6#1 0x00007f6b7470a97b in load_bmp_pf (f=f@entry=0x55da0b8775a0, pal=0x7ffdb59aa5e0, pal@entry=0x0) at /home/ibse/Downloads/allegro-4.4.3.1/src/bmp.c:699
7#2 0x00007f6b7470b58d in load_bmp (filename=<optimized out>, pal=0x0) at /home/ibse/Downloads/allegro-4.4.3.1/src/bmp.c:611
8#3 0x00007f6b7474e241 in load_bitmap (filename=0x55da0b373bc2 "/home/ibse/alexlogo.bmp", pal=0x0) at /home/ibse/Downloads/allegro-4.4.3.1/src/readbmp.c:81
9#4 0x000055da0b365e96 in main () at /home/ibse/Downloads/allegro-4.4.3.1/demos/skater/source/skater.c:5
Could anyone provide me with an example of how to use this routine correctly?