I have consistently segfaulted trying to load a TMX file into a *map.
int main(int argc, char *argv[])
{
ALLEGRO_DISPLAY *display = NULL;
ALLEGRO_EVENT_QUEUE *event_queue = NULL;
ALLEGRO_TIMER *timer = NULL;
ALLEGRO_KEYBOARD_STATE keyboard_state;
ALLEGRO_MAP *map = al_open_map("data/maps", "TestMap.tmx");
...
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/X/Desktop/Programming/C/AllegroRoboticsTest/
Adding source dir: /home/X/Desktop/Programming/C/AllegroRoboticsTest/
Adding file: /home/X/Desktop/Programming/C/AllegroRoboticsTest/bin/Debug/AllegroRoboticsTest
Changing directory to: /home/X/Desktop/Programming/C/AllegroRoboticsTest/.
Set variable: LD_LIBRARY_PATH=.:/usr/local/lib:/opt/opencascade/lib
Starting debugger: /usr/bin/gdb -nx -fullname -quiet -args /home/X/Desktop/Programming/C/AllegroRoboticsTest/bin/Debug/AllegroRoboticsTest
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Program received signal SIGSEGV, Segmentation fault.
In al_get_standard_path () (/usr/lib/liballegro.so.5.2)
#2 0x00005555555563ba in main (argc=1, argv=0x7fffffffe3a8) at /home/X/Desktop/Programming/C/AllegroRoboticsTest/main.c:45
At first I thought, maybe I just didn't build the library right, so I rebuilt it 2 more times, once as a static and another as a shared library.
The interesting thing is that it builds just fine when using the cmake files that came in the example.
I cannot recreate it though.
This is the callback after I moved the open map command into it's usual place, directly from the example that comes with allegro_tiled.
// If MAP_FOLDER is relative to the working directory and not the running
// executable, then add a call to `al_find_resources_as(RELATIVE_TO_CWD);`
// before calling `al_open_map()`.
//al_find_resources_as(RELATIVE_TO_CWD);
map = al_open_map("data/maps", "TestMap.tmx");
int map_total_width = al_get_map_width(map) * al_get_tile_width(map);
int map_total_height = al_get_map_height(map) * al_get_tile_height(map);
// Draw the map
al_clear_to_color(al_map_rgb(0, 0, 0));
al_draw_map_region(map, map_x, map_y, screen_width, screen_height, 0, 0, 0);
al_flip_display();
...
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Child process PID: 25749
In ____strtoll_l_internal () (/usr/lib/libc.so.6)
#3 0x0000555555556615 in main (argc=1, argv=0x7fffffffe3a8) at /home/X/Desktop/Programming/C/AllegroRoboticsTest/main.c:114