GLib-GIO-ERROR**: No GSettings schemas are installed on the system
Asked Answered
P

3

15

Unfortunately, I am using Windows (Windows7 x64). With MinGW compiler in Code::Blocks and GTK+3.6.4. I compiled manually all the schemas from glib.


When I use File Chooser dialogue / colorpicker - it doesn't matter, I am getting the following error: GLib-GIO-ERROR**: No GSettings schemas are installed on the system and the program terminates.


What do I have to do to fix this?

Pursuance answered 10/3, 2015 at 0:0 Comment(0)
I
17

GSettings looks at the compiled schemas in the directories pointed by the $XDG_DATA_DIR environment variable. You can either use a launcher script that sets up the environment for you, or you can rely on the prefix, and install the gschemas.compiled files in the share/glib-2.0/schemas directory under the same prefix as your app binary is, e.g. if you have the following layout:

YourApp/
  bin/
    YourApp.exe
  lib/
    libgtk3.dll
    libgobject.dll
    …
  share/
    …
    glib-2.0/
      schemas/

Make sure that the gschemas.compiled file is under YourApp/share/glib-2.0/schemas, and that the org.gtk.Settings.FileChooser.gschema.xml is there as well.

Inositol answered 10/3, 2015 at 11:21 Comment(6)
I never understood exactly the thing with that variable. Is this system environment variable that I can set from Advanced System Settings with the name XDG_DATA_DIR and the value of D:\apps\gtk\share\glib-2.0\schemas Also I am aiming to compile my programs statically.Pursuance
The XDG_DATA_DIR environment variable is a colon-separated list of directories, in decreasing order of preference, used to compute paths for files — see: standards.freedesktop.org/basedir-spec/basedir-spec-latest.htmlInositol
As an aside: GLib and GTK+ do not like much being statically compiled, as they have, or depend, on various run-time loadable modules. You can tweak the loading paths for most of them. In this case, though, loading a file has no bearing to static or dynamic linking. It's a location for ancillary files, and you can use environment variables to handle relocatability.Inositol
Might sound insolent.. but I see that you have enough knowledge to help. Do you have any free time to help by Team Viewer. I will keep one in mind for returning the favor. RETURN_SUCCESSPursuance
+1. This fixed it for me, and probably answers the question, though it's not marked as such (and was derailed).Orthopsychiatry
@Pursuance XDG_DATA_DIRS should not include the \share\glib-2.0\schemas part, i.e. only D:\apps\gtk in your case.Brahmani
O
10

The problem is with the Glib schemas that apparently are not compiled on your system.

You need the glib-compile-schemas and find the glib-2.0/schemas directory which is located in /usr/share/glib-2.0/schemas, I don't know if it will be found in the same path within MinGW, but I don't see why it wouldn't, so you must execute the following command1

glib-compile-schemas /usr/share/glib-2.0/schemas/

and that will create a file gschemas.compiled so you need write permission, then the error will go away.


1Provided that the GLib schemas are installed in that directory.

Oersted answered 10/3, 2015 at 0:4 Comment(4)
Because I am stuck to Windows so as many other users. By the way, I've already mentioned that I have compiled them successfully.. though they are already compiled in the bundle anyway (i.e gschemas.compiled already exists)Pursuance
Delete it an recompile it, or search for the .gschema.xml file corresponding to the missing schema and check if it was compiled successfuly or if it was compiled at all.Oersted
Well I tried with two different gschemas.compiled the first, that is compiled by default (as a bundle's 3rd party dependent) and the other, compiled manually by me. Though.. I needed to use intl.dll from gtk2's bin, because it didn't exist and that caused crash when using gsettings. On the other hand I have no idea of what checking you mind.Pursuance
Not compiled, or simply not copied into the executable's redistributable folder (along with DLLs, icons, themes, etc.)Orthopsychiatry
C
1

I could solve this issue from the following documentation as below https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html following environment variable to the share folders similar to below in my case

XDG_DATA_DIRS : D:\vcpkg\installed\x64-windows\share

Coming answered 31/5, 2021 at 17:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.