CMake is unable to find gio/gunixfdlist.h (Issue #26040)

10 views
Skip to first unread message

gmeeker

unread,
Dec 19, 2025, 12:04:57 PM (16 hours ago) Dec 19
to wx-...@googlegroups.com, Subscribed
gmeeker created an issue (wxWidgets/wxWidgets#26040)

Description

Building wxWidgets fails on Linux with glib < 2.74

Bug description:

CMake is unable to find gio/gunixfdlist.h which is only included when glib is older than 2.74. Compilation works with configure however. On Ubuntu 16, this header lives under /usr/include/gio-unix-2.0 which is related to gio-unix-2.0.pc I believe.

Expected vs observed behaviour:

cd /home/conan/wxWidgets-3.3.1/build_gtk/libs/core && /usr/local/bin/c++  -DWXBUILDING -DWXDLLNAME=wx_gtk2u_core-3.3 -DWXMAKINGDLL_CORE -DWXUSINGDLL -DWX_PRECOMP -D_FILE_OFFSET_BITS=64 -D_UNICODE -D__WXGTK2__ -D__WXGTK__ -DwxUSE_BASE=0 -DwxUSE_GUI=1 -Dwxcore_EXPORTS -I/home/conan/wxWidgets-3.3.1/src/tiff/libtiff -I/home/conan/wxWidgets-3.3.1/src/png -I/home/conan/wxWidgets-3.3.1/src/jpeg -I/home/conan/wxWidgets-3.3.1/build_gtk/lib/wx/include/gtk2-unicode-3.3 -I/home/conan/wxWidgets-3.3.1/include -I/usr/include/freetype2 -I/usr/include/x86_64-linux-gnu/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gtk-unix-print-2.0 -I/home/conan/wxWidgets-3.3.1/3rdparty/libwebp/src  -g -fPIC -fvisibility=hidden -fvisibility-inlines-hidden    -Winvalid-pch -include "/home/conan/wxWidgets-3.3.1/build_gtk/libs/core/cotire/wxcore_CXX_prefix.hxx"  -o CMakeFiles/wxcore.dir/__/__/__/src/gtk/power.cpp.o -c /home/conan/wxWidgets-3.3.1/src/gtk/power.cpp
/home/conan/wxWidgets-3.3.1/src/gtk/power.cpp:46:14: fatal error: gio/gunixfdlist.h: No such file or directory
   46 |     #include <gio/gunixfdlist.h>
      |              ^~~~~~~~~~~~~~~~~~~
compilation terminated.

Some relevant files on Ubuntu 16

/usr/include/gio-unix-2.0/gio/gunixfdlist.h
/usr/lib/x86_64-linux-gnu/pkgconfig/gio-2.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gio-unix-2.0.pc

Patch or snippet allowing to reproduce the problem:

To Reproduce:

Because this OS is so old, I'm using a docker image. I'm running in Kubernetes below but you could use KVM or Docker Desktop instead. (System libpng in Ubuntu 16 is too old, so builtin must be used to avoid a different failure.)

kubectl run wxwidgets -it --restart=Never --image=conanio/gcc11-ubuntu16.04

sudo apt update
sudo apt install -y libgtk2.0-dev libsecret-1-dev libcairo2-dev

curl -L -o wxWidgets-3.3.1.tar.bz2 https://github.com/wxWidgets/wxWidgets/releases/download/v3.3.1/wxWidgets-3.3.1.tar.bz2
tar xjvf wxWidgets-3.3.1.tar.bz2
cd wxWidgets-3.3.1
mkdir build_gtk
cd build_gtk
cmake -G "Unix Makefiles" -DwxBUILD_TOOLKIT=gtk2 -DwxUSE_LIBPNG=builtin ..
VERBOSE=1 cmake --build .

Platform and version information

  • wxWidgets version: 3.3.1
  • wxWidgets port: wxGTK
  • OS: Ubuntu 16:
    • GTK version: 2.24.30
    • Which GDK: X11
    • Desktop environment: Gnome


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26040@github.com>

Maarten

unread,
Dec 19, 2025, 6:02:36 PM (10 hours ago) Dec 19
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#26040)

For gtk2 we rely on CMake's (unmaintained) FindGTK2, called here:
https://github.com/wxWidgets/wxWidgets/blob/7b8195f5c4498022247088af2594a5fb5fffa2a5/build/cmake/toolkit.cmake#L82-L83

I guess ${gtk_lib}_INCLUDE_DIRS does not include this gio directory?

We could add our own FindGTK2.cmake module that uses pkgconfig, maybe it will have the same paths as configure then. Basically a copy of FindGTK3 and FindGTK4, but with an addition to use CMake's FindGTK2 if we can't find it.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26040/3676950219@github.com>

Reply all
Reply to author
Forward
0 new messages