c - invalid conversion from 'int' to 'GKeyFileFlags' -
i have 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 usage of glib gkeyfile parser in this tutorial read number of machine1 8.
so copy-paste part in main
int main() { gkeyfile *keyfile; gkeyfileflags flags; gerror *error = null; gsize length; /* create new gkeyfile object , bitwise list of flags. */ keyfile = g_key_file_new (); flags = g_key_file_keep_comments | g_key_file_keep_translations; /* load gkeyfile keyfile.conf or return. */ if (!g_key_file_load_from_file (keyfile, "config.conf", flags, &error)) { g_error (error->message); return -1; } }
but have error
invalid conversion 'int' 'gkeyfileflags'
where error here?
so problem apparently trying compile c code c++, isn't, compiler complains. modify settings c source files compiled c compiler, , c++ source files c++ compiler.
Comments
Post a Comment