GNOME Bugzilla – Bug 754245
common/dconf-changeset.h etc. lack extern "C" wrapper for C++
Last modified: 2018-09-21 16:15:18 UTC
Somewhat unexpectedly, common/dconf-changeset.h etc. (as included from dconf/dconf.h) lack the usual #ifdef __cplusplus extern "C" { #endif ... wrappers, so naively doing #include <dconf/dconf.h> ... dconf_changeset_new(); in C++ code will lead to linker errors about an undefined reference to a (mangled name) dconf_changeset_new C++ function. This is apparently not a problem for the functions decleared in dconf-client.h, presumably because G_BEGIN/END_DECLS covers those extern "C" wrappers for C++.
Indeed, G_BEGIN/END_DECLS is just that: extern "C" { }
I'm sure a patch that wraps all the installed headers in extern "C" { } would be welcome
Created attachment 318323 [details] [review] fix
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/dconf/issues/23.