Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » [BUG] Crash when trying to save a configuration file - Allegro 5.0.9

This thread is locked; no one can reply to it. rss feed Print
[BUG] Crash when trying to save a configuration file - Allegro 5.0.9
JeffSturmann
Member #13,969
February 2012

Hello,

I am having a trouble when i try to save a simple configuration file using Allegro
5.0.9. :( When the program call the al_save_config_file() routine, the entire application crashes! (yes, i debugged it).

I wrote a very small program as a example and i putted it in attachment (ConfigFiles.cpp). I tested it and it still crashes when i run :'(

I´m using MinGW 4.7.1 and the correct Allegro binaries for this version.

Someone could help me? ::)

SiegeLord
Member #7,827
October 2006
avatar

You need to initialize PhysFS using PHYSFS_init.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

JeffSturmann
Member #13,969
February 2012

i'm initializing physfs using al_set_physfs_file_interface() and i could not find the PHYSFS_init() routine ??? .

I tried to run the program without the PhysFS file interface and it worked fine!
How i could solve this problem with the PhysFS? (i will use .zip files in my project, so i will need it)

Thanks in advance ;)

SiegeLord
Member #7,827
October 2006
avatar

i'm initializing physfs using al_set_physfs_file_interface()

al_set_physfs_file_interface does not initialize PhysFS, I don't know why you would think that. It only sets up Allegro file functions to use PhysFS functions instead of the ones from C standard library

Quote:

i could not find the PHYSFS_init() routine

Where did you look? It's a PhysFS function, not an Allegro function. You'll need to include the physfs.h header to get it to work. In general, look at ex_physfs.c example for an example of how to use it with Allegro.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Go to: