gnome.gio
importGIO 2.82.5 — files, streams, sockets, D-Bus, GSettings and GListModel
import gnome.gio;
#include <gio/gio.h>
Module name taken from this index's own test project for the package.
mcpp add gnome.gio@2.82.5
Usage
From this repository's own test project — built and run by CI, not written for the website.
// ⭐ THE MODULE, WHICH IS WHAT THE NAMESPACE PROMISES.
//
// In this index the namespace is the contract: `compat.xxx` is consumed with
// `#include`, an owner namespace like `gnome.xxx` exposes `import`. The test
// next to this file consumes gnome.gio through its headers; this one consumes
// the same package through its module, so both doors are checked from the
// OUTSIDE — which is what an index example is for.
//
// ⚠️ THE TWO DOORS DO NOT COMPOSE, and that is GCC's rule rather than a choice
// here. A TU that imports the module AND textually includes a glib header
// reaches <time.h> twice — once through the module's global fragment, once
// directly — and the same `struct tm` from the same file becomes two entities:
//
// error: conflicting declaration 'struct tm'
// note: previous declaration as 'struct tm' (of module gnome.glib)
//
// So a consumer picks ONE route, and which one is decided by macros: a module
// cannot carry them, and glib's are half its API. Code using `G_DEFINE_TYPE`,
// `G_OBJECT` or `G_TYPE_*` takes the header route. Code using the FUNCTION API
// — most of gio, and much of glib — imports and includes nothing.
#ifdef __linux__
// …
tests/examples/gio/tests/module.cpp · project tests/examples/gio
Build · upstream manifest
- targets
gio-2_0 (lib), gio (lib)- language
c++23- manifest version
2.82.5- dependencies
gnome, compat- source
https://raw.githubusercontent.com/mcpplibs/glib/2.82.5/mcpp/gio/mcpp.toml