I have the following config file Config.cfg
[DD]
user=**
password=***
database=****
IPServidor=****
port=3306
[Machine]
Machine1=8
Temp=5=1001
Hum=7=1002
Link=8=1003
Volt=9=1004
With the usage of GLib GKeyFile Parser in this tutorial I would like to read the number of Machine1 which is 8.
So I copy-paste this part in main
int main()
{
GKeyFile *keyfile;
GKeyFileFlags flags;
GError *error = NULL;
gsize length;
/* Create a new GKeyFile object and a bitwise list of flags. */
keyfile = g_key_file_new ();
flags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS;
/* Load the GKeyFile from keyfile.conf or return. */
if (!g_key_file_load_from_file (keyfile, "Config.conf", flags, &error))
{
g_error (error->message);
return -1;
}
}
but I have error
invalid conversion from 'int' to 'GKeyFileFlags'
Where is the error here?