Tweaking include path?

Hey,
for someone with C++ programming skills probably a piece of cake:
I’m trying to bring fingerprint-gui to qt5: Welcome - openSUSE Build Service

In the current situation I fell into a compilation error at:

6s] In file included from /usr/include/libfprint-2/fp-device.h:23,
6s]                  from /usr/include/libfprint-2/fp-context.h:22,
6s]                  from /usr/include/libfprint-2/fprint.h:22,
6s]                  from ../../include/Globals.h:40,
6s]                  from ../../include/GlobalsImg.h:4,
6s]                  from ../../src/GlobalsImg.cpp:3:
6s] /usr/include/libfprint-2/fp-image.h:23:10: fatal error: gio/gio.h: No such file or directory
6s]    23 | #include <gio/gio.h>

glib2-devel is installed, so the include is under /usr/include/glib-2.0. Patching the fp-image.h in the local copy if libfprint to look for #include <glib-2.0/gio/gio.h>. That helped in this case, but just moved the error:

103s] In file included from /usr/include/libfprint-2/fp-image.h:23,
103s] from /usr/include/libfprint-2/fp-device.h:23,
103s] from /usr/include/libfprint-2/fp-context.h:22,
103s] from /usr/include/libfprint-2/fprint.h:22,
103s] from …/…/include/Globals.h:40,
103s] from …/…/include/GlobalsImg.h:4,
103s] from …/…/src/GlobalsImg.cpp:3:
103s] /usr/include/glib-2.0/gio/gio.h:26:10: fatal error: gio/giotypes.h: No such file or directory
103s] 26 | #include <gio/giotypes.h>

-> the error has just moved.
I guess there is a trick to tell the program to look in /usr/include/glib-2.0 instead /usr/include in general?
Thanks!

cc -I/usr/include/glib-2.0

That is exactly what pkg-config is for - to portably query which options are needed to compile/build/etc against specific library.

I have
BuildRequires: pkgconfig(glib-2.0)
in the specfile - but that did not help

Hi
It’s the build file (eg Makefile, cmake, meson etc) that needs the pkg-config command to read the .pc file which contains the information on what flags to use.


pkg-config --cflags glib-2.0

-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include

Hi Malcolm,
for the very stupid under us (me):

  • Adding BuildRequires: cmake(glib2) does obviously not fix it
  • %qmake5 PREFIX=/usr QMAKE_CXXFLAGS=“-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include” does obviously work (Hoooray!)
    …which now leads to a new error:
9s] In file included from /usr/include/qt5/QtCore/qobject.h:46,
9s]                  from /usr/include/qt5/QtCore/qabstractanimation.h:43,
9s]                  from /usr/include/qt5/QtCore/QtCore:6,
9s]                  from /usr/include/qt5/QtWidgets/QtWidgetsDepends:3,
9s]                  from /usr/include/qt5/QtWidgets/QtWidgets:3,
9s]                  from ../../src/GlobalsImg.cpp:1:
9s] /usr/include/glib-2.0/gio/gdbusintrospection.h:155:25: error: expected unqualified-id before 'public'
9s]   155 |   GDBusSignalInfo     **signals;
9s]       |                         ^~~~~~~

Hi
I would normally create a qmake cache file for the options in %build…


%build
cat > .qmake.cache <<EOF
QMAKE_CXXFLAGS += `pkg-config --libs glib-2.0`
EOF

The error I would guess is any changes in QT that the source code (4 years old) has not been updated to align with the likes of QtWidgets etc… your heading down the rabbit hole by the looks…

looks like…following my issue https://github.com/Tilka/fingerprint-gui/issues/3 the author has archived the project. So, as long as no qt5-expert steps up, i see not much hope for this.