Is there any cross platform way to find out which dir should be my applications configuration?
For example, Mozilla Firefox uses /home/user/.mozilla on linux, and %APPDATA%\Mozilla on Windows.
http://kb.mozillazine.org/Profile_folder_-_Firefox#Navigating_to_the_profile_folder
Is there any lib that deals with it, or is it just lots of #ifdef?
Mozilla is an old app and has kept its configuration in $HOME/.mozilla for quite some time. New apps, however, are encouraged to instead store configuration files in $HOME/.config/myappname.
I would assume most of the generic cross platform libraries have a way of getting the base configuration directory (usually $HOME/.config/ on Linux and %APPDATA on Windows). GLib, for example, has g_get_user_config_dir() , and all you need to do is append your app name to the result (untested code):