Popax21 / synaTudor

GNU Lesser General Public License v2.1
91 stars 10 forks source link

Compile error: unknown type name ‘FpDeviceFeature’ #9

Closed DueJ77 closed 1 year ago

DueJ77 commented 1 year ago

When trying to compile, this error occurs.

[68/84] Compiling C object libfprint-tod/libtudor_tod.so.p/src_data.c.o
FAILED: libfprint-tod/libtudor_tod.so.p/src_data.c.o 
cc -Ilibfprint-tod/libtudor_tod.so.p -Ilibfprint-tod -I../libfprint-tod -I../libtudor/inc -I../tudor-host/inc -I../tudor-host-launcher/inc -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -I/usr/include/gusb-1 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -pthread -D_GNU_SOURCE -Wno-missing-braces -MD -MQ libfprint-tod/libtudor_tod.so.p/src_data.c.o -MF libfprint-tod/libtudor_tod.so.p/src_data.c.o.d -o libfprint-tod/libtudor_tod.so.p/src_data.c.o -c ../libfprint-tod/src/data.c
In file included from /usr/include/libfprint-2/tod-1/drivers_api.h:26,
                 from ../libfprint-tod/src/device.h:5,
                 from ../libfprint-tod/src/data.h:5,
                 from ../libfprint-tod/src/data.c:2:
/usr/include/libfprint-2/tod-1/fpi-device.h:183:3: error: unknown type name ‘FpDeviceFeature’
  183 |   FpDeviceFeature features;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/libfprint-2/tod-1/fpi-assembling.h:23,
                 from /usr/include/libfprint-2/tod-1/drivers_api.h:25:
/usr/include/libfprint-2/tod-1/fpi-device.h:196:33: error: ‘FpDeviceFeature’ undeclared here (not in a function); did you mean ‘FpDeviceRetry’?
  196 |                         sizeof (FpDeviceFeature) +
      |                                 ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/tod/tod-macros.h:23:68: note: in definition of macro ‘TOD_PADDING’
   23 |   char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
      |                                                                    ^~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:195:3: note: in expansion of macro ‘TOD_PADDING_ALIGNED8’
  195 |   TOD_PADDING_ALIGNED8 (32,
      |   ^~~~~~~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:293:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  293 |                                  FpDeviceFeature update,
      |                                  ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:294:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  294 |                                  FpDeviceFeature value);
      |                                  ^~~~~~~~~~~~~~~
[71/84] Compiling C object libfprint-tod/libtudor_tod.so.p/src_device.c.o
FAILED: libfprint-tod/libtudor_tod.so.p/src_device.c.o 
cc -Ilibfprint-tod/libtudor_tod.so.p -Ilibfprint-tod -I../libfprint-tod -I../libtudor/inc -I../tudor-host/inc -I../tudor-host-launcher/inc -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -I/usr/include/gusb-1 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -pthread -D_GNU_SOURCE -Wno-missing-braces -MD -MQ libfprint-tod/libtudor_tod.so.p/src_device.c.o -MF libfprint-tod/libtudor_tod.so.p/src_device.c.o.d -o libfprint-tod/libtudor_tod.so.p/src_device.c.o -c ../libfprint-tod/src/device.c
In file included from /usr/include/libfprint-2/tod-1/drivers_api.h:26,
                 from ../libfprint-tod/src/device.h:5,
                 from ../libfprint-tod/src/device.c:1:
/usr/include/libfprint-2/tod-1/fpi-device.h:183:3: error: unknown type name ‘FpDeviceFeature’
  183 |   FpDeviceFeature features;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/libfprint-2/tod-1/fpi-assembling.h:23,
                 from /usr/include/libfprint-2/tod-1/drivers_api.h:25:
/usr/include/libfprint-2/tod-1/fpi-device.h:196:33: error: ‘FpDeviceFeature’ undeclared here (not in a function); did you mean ‘FpDeviceRetry’?
  196 |                         sizeof (FpDeviceFeature) +
      |                                 ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/tod/tod-macros.h:23:68: note: in definition of macro ‘TOD_PADDING’
   23 |   char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
      |                                                                    ^~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:195:3: note: in expansion of macro ‘TOD_PADDING_ALIGNED8’
  195 |   TOD_PADDING_ALIGNED8 (32,
      |   ^~~~~~~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:293:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  293 |                                  FpDeviceFeature update,
      |                                  ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:294:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  294 |                                  FpDeviceFeature value);
      |                                  ^~~~~~~~~~~~~~~
[73/84] Compiling C object libfprint-tod/libtudor_tod.so.p/src_ipc.c.o
FAILED: libfprint-tod/libtudor_tod.so.p/src_ipc.c.o 
cc -Ilibfprint-tod/libtudor_tod.so.p -Ilibfprint-tod -I../libfprint-tod -I../libtudor/inc -I../tudor-host/inc -I../tudor-host-launcher/inc -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -I/usr/include/gusb-1 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -pthread -D_GNU_SOURCE -Wno-missing-braces -MD -MQ libfprint-tod/libtudor_tod.so.p/src_ipc.c.o -MF libfprint-tod/libtudor_tod.so.p/src_ipc.c.o.d -o libfprint-tod/libtudor_tod.so.p/src_ipc.c.o -c ../libfprint-tod/src/ipc.c
In file included from /usr/include/libfprint-2/tod-1/drivers_api.h:26,
                 from ../libfprint-tod/src/ipc.c:3:
/usr/include/libfprint-2/tod-1/fpi-device.h:183:3: error: unknown type name ‘FpDeviceFeature’
  183 |   FpDeviceFeature features;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/libfprint-2/tod-1/fpi-assembling.h:23,
                 from /usr/include/libfprint-2/tod-1/drivers_api.h:25:
/usr/include/libfprint-2/tod-1/fpi-device.h:196:33: error: ‘FpDeviceFeature’ undeclared here (not in a function); did you mean ‘FpDeviceRetry’?
  196 |                         sizeof (FpDeviceFeature) +
      |                                 ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/tod/tod-macros.h:23:68: note: in definition of macro ‘TOD_PADDING’
   23 |   char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
      |                                                                    ^~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:195:3: note: in expansion of macro ‘TOD_PADDING_ALIGNED8’
  195 |   TOD_PADDING_ALIGNED8 (32,
      |   ^~~~~~~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:293:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  293 |                                  FpDeviceFeature update,
      |                                  ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:294:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  294 |                                  FpDeviceFeature value);
      |                                  ^~~~~~~~~~~~~~~
[74/84] Compiling C object libfprint-tod/libtudor_tod.so.p/src_suspend.c.o
FAILED: libfprint-tod/libtudor_tod.so.p/src_suspend.c.o 
cc -Ilibfprint-tod/libtudor_tod.so.p -Ilibfprint-tod -I../libfprint-tod -I../libtudor/inc -I../tudor-host/inc -I../tudor-host-launcher/inc -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -I/usr/include/gusb-1 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -pthread -D_GNU_SOURCE -Wno-missing-braces -MD -MQ libfprint-tod/libtudor_tod.so.p/src_suspend.c.o -MF libfprint-tod/libtudor_tod.so.p/src_suspend.c.o.d -o libfprint-tod/libtudor_tod.so.p/src_suspend.c.o -c ../libfprint-tod/src/suspend.c
In file included from /usr/include/libfprint-2/tod-1/drivers_api.h:26,
                 from ../libfprint-tod/src/device.h:5,
                 from ../libfprint-tod/src/suspend.h:4,
                 from ../libfprint-tod/src/suspend.c:2:
/usr/include/libfprint-2/tod-1/fpi-device.h:183:3: error: unknown type name ‘FpDeviceFeature’
  183 |   FpDeviceFeature features;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/libfprint-2/tod-1/fpi-assembling.h:23,
                 from /usr/include/libfprint-2/tod-1/drivers_api.h:25:
/usr/include/libfprint-2/tod-1/fpi-device.h:196:33: error: ‘FpDeviceFeature’ undeclared here (not in a function); did you mean ‘FpDeviceRetry’?
  196 |                         sizeof (FpDeviceFeature) +
      |                                 ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/tod/tod-macros.h:23:68: note: in definition of macro ‘TOD_PADDING’
   23 |   char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
      |                                                                    ^~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:195:3: note: in expansion of macro ‘TOD_PADDING_ALIGNED8’
  195 |   TOD_PADDING_ALIGNED8 (32,
      |   ^~~~~~~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:293:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  293 |                                  FpDeviceFeature update,
      |                                  ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:294:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  294 |                                  FpDeviceFeature value);
      |                                  ^~~~~~~~~~~~~~~
[75/84] Compiling C object libfprint-tod/libtudor_tod.so.p/src_open.c.o
FAILED: libfprint-tod/libtudor_tod.so.p/src_open.c.o 
cc -Ilibfprint-tod/libtudor_tod.so.p -Ilibfprint-tod -I../libfprint-tod -I../libtudor/inc -I../tudor-host/inc -I../tudor-host-launcher/inc -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -I/usr/include/gusb-1 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -pthread -D_GNU_SOURCE -Wno-missing-braces -MD -MQ libfprint-tod/libtudor_tod.so.p/src_open.c.o -MF libfprint-tod/libtudor_tod.so.p/src_open.c.o.d -o libfprint-tod/libtudor_tod.so.p/src_open.c.o -c ../libfprint-tod/src/open.c
In file included from /usr/include/libfprint-2/tod-1/drivers_api.h:26,
                 from ../libfprint-tod/src/device.h:5,
                 from ../libfprint-tod/src/open.h:5,
                 from ../libfprint-tod/src/open.c:5:
/usr/include/libfprint-2/tod-1/fpi-device.h:183:3: error: unknown type name ‘FpDeviceFeature’
  183 |   FpDeviceFeature features;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/libfprint-2/tod-1/fpi-assembling.h:23,
                 from /usr/include/libfprint-2/tod-1/drivers_api.h:25:
/usr/include/libfprint-2/tod-1/fpi-device.h:196:33: error: ‘FpDeviceFeature’ undeclared here (not in a function); did you mean ‘FpDeviceRetry’?
  196 |                         sizeof (FpDeviceFeature) +
      |                                 ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/tod/tod-macros.h:23:68: note: in definition of macro ‘TOD_PADDING’
   23 |   char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
      |                                                                    ^~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:195:3: note: in expansion of macro ‘TOD_PADDING_ALIGNED8’
  195 |   TOD_PADDING_ALIGNED8 (32,
      |   ^~~~~~~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:293:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  293 |                                  FpDeviceFeature update,
      |                                  ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:294:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  294 |                                  FpDeviceFeature value);
      |                                  ^~~~~~~~~~~~~~~
../libfprint-tod/src/open.c: In function ‘open_device’:
../libfprint-tod/src/open.c:241:27: warning: initialization of ‘void **’ from incompatible pointer type ‘GUsbDevicePrivate *’ {aka ‘struct _GUsbDevicePrivate *’} [-Wincompatible-pointer-types]
  241 |         void **dev_priv = usb_dev->priv;
      |                           ^~~~~~~
[76/84] Compiling C object libfprint-tod/libtudor_tod.so.p/src_enroll.c.o
FAILED: libfprint-tod/libtudor_tod.so.p/src_enroll.c.o 
cc -Ilibfprint-tod/libtudor_tod.so.p -Ilibfprint-tod -I../libfprint-tod -I../libtudor/inc -I../tudor-host/inc -I../tudor-host-launcher/inc -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -I/usr/include/gusb-1 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -pthread -D_GNU_SOURCE -Wno-missing-braces -MD -MQ libfprint-tod/libtudor_tod.so.p/src_enroll.c.o -MF libfprint-tod/libtudor_tod.so.p/src_enroll.c.o.d -o libfprint-tod/libtudor_tod.so.p/src_enroll.c.o -c ../libfprint-tod/src/enroll.c
In file included from /usr/include/libfprint-2/tod-1/drivers_api.h:26,
                 from ../libfprint-tod/src/device.h:5,
                 from ../libfprint-tod/src/data.h:5,
                 from ../libfprint-tod/src/enroll.c:1:
/usr/include/libfprint-2/tod-1/fpi-device.h:183:3: error: unknown type name ‘FpDeviceFeature’
  183 |   FpDeviceFeature features;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/libfprint-2/tod-1/fpi-assembling.h:23,
                 from /usr/include/libfprint-2/tod-1/drivers_api.h:25:
/usr/include/libfprint-2/tod-1/fpi-device.h:196:33: error: ‘FpDeviceFeature’ undeclared here (not in a function); did you mean ‘FpDeviceRetry’?
  196 |                         sizeof (FpDeviceFeature) +
      |                                 ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/tod/tod-macros.h:23:68: note: in definition of macro ‘TOD_PADDING’
   23 |   char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
      |                                                                    ^~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:195:3: note: in expansion of macro ‘TOD_PADDING_ALIGNED8’
  195 |   TOD_PADDING_ALIGNED8 (32,
      |   ^~~~~~~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:293:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  293 |                                  FpDeviceFeature update,
      |                                  ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:294:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  294 |                                  FpDeviceFeature value);
      |                                  ^~~~~~~~~~~~~~~
[77/84] Compiling C object libfprint-tod/libtudor_tod.so.p/src_verify.c.o
FAILED: libfprint-tod/libtudor_tod.so.p/src_verify.c.o 
cc -Ilibfprint-tod/libtudor_tod.so.p -Ilibfprint-tod -I../libfprint-tod -I../libtudor/inc -I../tudor-host/inc -I../tudor-host-launcher/inc -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -I/usr/include/gusb-1 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -pthread -D_GNU_SOURCE -Wno-missing-braces -MD -MQ libfprint-tod/libtudor_tod.so.p/src_verify.c.o -MF libfprint-tod/libtudor_tod.so.p/src_verify.c.o.d -o libfprint-tod/libtudor_tod.so.p/src_verify.c.o -c ../libfprint-tod/src/verify.c
In file included from /usr/include/libfprint-2/tod-1/drivers_api.h:26,
                 from ../libfprint-tod/src/device.h:5,
                 from ../libfprint-tod/src/data.h:5,
                 from ../libfprint-tod/src/verify.c:1:
/usr/include/libfprint-2/tod-1/fpi-device.h:183:3: error: unknown type name ‘FpDeviceFeature’
  183 |   FpDeviceFeature features;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/libfprint-2/tod-1/fpi-assembling.h:23,
                 from /usr/include/libfprint-2/tod-1/drivers_api.h:25:
/usr/include/libfprint-2/tod-1/fpi-device.h:196:33: error: ‘FpDeviceFeature’ undeclared here (not in a function); did you mean ‘FpDeviceRetry’?
  196 |                         sizeof (FpDeviceFeature) +
      |                                 ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/tod/tod-macros.h:23:68: note: in definition of macro ‘TOD_PADDING’
   23 |   char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
      |                                                                    ^~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:195:3: note: in expansion of macro ‘TOD_PADDING_ALIGNED8’
  195 |   TOD_PADDING_ALIGNED8 (32,
      |   ^~~~~~~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:293:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  293 |                                  FpDeviceFeature update,
      |                                  ^~~~~~~~~~~~~~~
/usr/include/libfprint-2/tod-1/fpi-device.h:294:34: error: expected declaration specifiers or ‘...’ before ‘FpDeviceFeature’
  294 |                                  FpDeviceFeature value);
      |                                  ^~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

I am running Ubuntu 22.10.

Popax21 commented 1 year ago

Seems like a recent libfprint update might have broken something - what version of libfprint(-tod) are you running on?

DueJ77 commented 1 year ago

dpkg -l libfprint* shows:

Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
| Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/
         Halb installiert/Trigger erWartet/Trigger anhängig
|/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht)
||/ Name                      Version                Architektur  Beschreibung
+++-=========================-======================-============-========================================================================
ii  libfprint-2-2:amd64       1:1.94.5+tod1-0ubuntu1 amd64        async fingerprint library of fprint project, shared libraries
ii  libfprint-2-dev:amd64     1:1.94.5+tod1-0ubuntu1 amd64        async fingerprint library of fprint project, development headers
un  libfprint-2-doc           <keine>                <keine>      (keine Beschreibung vorhanden)
ii  libfprint-2-tod-dev:amd64 1:1.94.5+tod1-0ubuntu1 amd64        async fingerprint library of fprint project, drivers development headers
ii  libfprint-2-tod1:amd64    1:1.94.5+tod1-0ubuntu1 amd64        async fingerprint library of fprint project, drivers shared libraries
Popax21 commented 1 year ago

That's really weird - the driver compiles fine on Arch using the latest version of libfprint-tod-git, and looking through the TOD source code FpDeviceFeature doesn't seem to have been removed / changed there either.

Can you try to reinstall libfprint-tod, and/or send the contents of /usr/include/libfprint-2/tod-1/fp-device.h if that doesn't work?

DueJ77 commented 1 year ago

I reinstalled libfprint-2-tod-dev and libfprint-2-tod1. Error still exists. In /usr/include/libfprint-2/tod-1/ there are only following files: ls -l /usr/include/libfprint-2/tod-1/

-rw-r--r-- 1 root root  1226 Okt 13 20:42 drivers_api.h
-rw-r--r-- 1 root root  4583 Okt 13 20:42 fpi-assembling.h
-rw-r--r-- 1 root root 24232 Okt 13 20:42 fpi-byte-reader.h
-rw-r--r-- 1 root root 15230 Okt 13 20:42 fpi-byte-utils.h
-rw-r--r-- 1 root root 14147 Okt 13 20:42 fpi-byte-writer.h
-rw-r--r-- 1 root root  2038 Okt 13 20:42 fpi-compat.h
-rw-r--r-- 1 root root  1233 Okt 13 20:42 fpi-context.h
-rw-r--r-- 1 root root 13882 Okt 13 20:42 fpi-device.h
-rw-r--r-- 1 root root  1315 Okt 14 00:18 fpi-enums.h
-rw-r--r-- 1 root root  6199 Okt 13 20:42 fpi-image-device.h
-rw-r--r-- 1 root root  2487 Okt 13 20:42 fpi-image.h
-rw-r--r-- 1 root root  2522 Okt 13 20:42 fpi-log.h
-rw-r--r-- 1 root root  1281 Okt 13 20:42 fpi-minutiae.h
-rw-r--r-- 1 root root  1622 Okt 13 20:42 fpi-print.h
-rw-r--r-- 1 root root  4179 Okt 13 20:42 fpi-spi-transfer.h
-rw-r--r-- 1 root root  5148 Okt 13 20:42 fpi-ssm.h
-rw-r--r-- 1 root root  6092 Okt 13 20:42 fpi-usb-transfer.h
drwxr-xr-x 2 root root  4096 Dez  3 23:44 tod
DueJ77 commented 1 year ago

The content of /usr/include/libfprint-2/tod-1/fpi-device.h:

/*
 * FpDevice - A fingerprint reader device
 * Copyright (C) 2019 Benjamin Berg <bberg@redhat.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#pragma once

#include <gusb.h>
#include "fp-device.h"
#include "fp-image.h"
#include "fpi-print.h"
#include "tod/tod-macros.h"

/**
 * FpiDeviceUdevSubtypeFlags:
 * @FPI_DEVICE_UDEV_SUBTYPE_SPIDEV: The device requires an spidev node
 * @FPI_DEVICE_UDEV_SUBTYPE_HIDRAW: The device requires a hidraw node
 *
 * Bitfield of required hardware resources for a udev-backed device.
 */
typedef enum {
  FPI_DEVICE_UDEV_SUBTYPE_SPIDEV = 1 << 0,
  FPI_DEVICE_UDEV_SUBTYPE_HIDRAW = 1 << 1,
} FpiDeviceUdevSubtypeFlags;

/**
 * FpIdEntry:
 *
 * An entry in the table of supported hardware. For USB devices, the product ID
 * and vendor ID should be provided. The optional @driver_data field defaults
 * to 0 and can be used as a simple flag for device quirks.
 */
typedef struct _FpIdEntry FpIdEntry;

struct _FpIdEntry
{
  union
  {
    struct
    {
      guint pid;
      guint vid;
    };
    const gchar *virtual_envvar;
  };
  guint64 driver_data;

  /* Elements added after TODv1 */
  union
  {
    struct
    {
      FpiDeviceUdevSubtypeFlags udev_types;
      const gchar              *spi_acpi_id;
      struct
      {
        guint pid;
        guint vid;
      } hid_id;
    };
  };

  /*< private >*/
  /* padding for future expansion */
  TOD_PADDING_ALIGNED (16,
                       sizeof (guint) * 2 +
                       sizeof (FpiDeviceUdevSubtypeFlags) +
                       sizeof (gpointer));
};

/**
 * FpDeviceClass:
 * @id: ID string for the driver. Should be a valid C identifier and should
 *   match the drivers file name.
 * @full_name: Human readable description of the driver
 * @type: The type of driver
 * @id_table: The table of IDs to bind the driver to
 * @features: The features the device supports, it can be initialized using
 *   fpi_device_class_auto_initialize_features() on @class_init.
 * @nr_enroll_stages: The number of enroll stages supported devices need; use
 *   fpi_device_set_nr_enroll_stages() from @probe if this is dynamic.
 * @scan_type: The scan type of supported devices; use
 *   fpi_device_set_scan_type() from @probe if this is dynamic.
 * @temp_hot_seconds: Assumed time in seconds for the device to become too hot
 *   after being mostly cold. Set to -1 if the device can be always-on.
 * @temp_cold_seconds: Assumed time in seconds for the device to be mostly cold
 *   after having been too hot to operate.
 * @usb_discover: Class method to check whether a USB device is supported by
 *  the driver. Should return 0 if the device is unsupported and a positive
 *  score otherwise. The default score is 50 and the driver with the highest
 *  score will be loaded.
 * @probe: Called immediately for all devices. Most drivers will not need to
 *   implement this. Drivers should setup the device identifier from the probe
 *   callback which will be used to verify the compatibility of stored
 *   #FpPrint's. It is permissible to temporarily open the USB device if this
 *   is required for the operation. If an error is returned, then the device
 *   will be destroyed again immediately and never reported to the API user.
 * @open: Open the device for further operations. Any of the normal actions are
 *   guaranteed to only happen when the device is open (this includes delete).
 * @close: Close the device again
 * @enroll: Start an enroll operation
 * @verify: Start a verify operation
 * @identify: Start an identify operation
 * @capture: Start a capture operation
 * @list: List prints stored on the device
 * @delete: Delete a print from the device
 * @clear_storage: Delete all prints from the device
 * @cancel: Called on cancellation, this is a convenience to not need to handle
 *   the #GCancellable directly by using fpi_device_get_cancellable().
 * @suspend: Called when an interactive action is running (ENROLL, VERIFY,
 *    IDENTIFY or CAPTURE) and the system is about to go into suspend.
 * @resume: Called to resume an ongoing interactive action after the system has
 *    resumed from suspend.
 *
 * NOTE: If your driver is image based, then you should subclass #FpImageDevice
 * instead. #FpImageDevice based drivers use a different way of interacting
 * with libfprint.
 *
 * These are the main entry points for drivers to implement. Drivers may not
 * implement all of these entry points if they do not support the operation
 * (or a default implementation is sufficient).
 *
 * Drivers must eventually call the corresponding function to finish the
 * operation. It is also acceptable to call the generic
 * fpi_device_action_error() function but doing so is not recommended in most
 * usecases.
 *
 * Drivers must also handle cancellation properly for any long running
 * operation (i.e. any operation that requires capturing). It is entirely fine
 * to ignore cancellation requests for short operations (e.g. open/close).
 *
 * Note that @cancel, @suspend and @resume will not be called while the device
 * is within a fpi_device_critical_enter()/fpi_device_critical_leave() block.
 *
 * This API is solely intended for drivers. It is purely internal and neither
 * API nor ABI stable.
 */
struct _FpDeviceClass
{
  /*< private >*/
  GObjectClass parent_class;

  /*< public >*/
  /* Static information about the driver. */
  const gchar     *id;
  const gchar     *full_name;
  FpDeviceType     type;
  const FpIdEntry *id_table;

  /* Defaults for device properties */
  gint       nr_enroll_stages;
  FpScanType scan_type;

  /* Callbacks */
  gint (*usb_discover) (GUsbDevice *usb_device);
  void (*probe)    (FpDevice *device);
  void (*open)     (FpDevice *device);
  void (*close)    (FpDevice *device);
  void (*enroll)   (FpDevice *device);
  void (*verify)   (FpDevice *device);
  void (*identify) (FpDevice *device);
  void (*capture)  (FpDevice *device);
  void (*list)     (FpDevice *device);
  void (*delete)   (FpDevice * device);

  void (*cancel)   (FpDevice *device);

  /* Class elements added after tod-v1 */
  FpDeviceFeature features;

  /* Simple device temperature model constants */
  gint32 temp_hot_seconds;
  gint32 temp_cold_seconds;

  void   (*clear_storage)  (FpDevice * device);
  void   (*suspend)  (FpDevice *device);
  void   (*resume)   (FpDevice *device);

  /*< private >*/
  /* padding for future expansion */
  TOD_PADDING_ALIGNED8 (32,
                        sizeof (FpDeviceFeature) +
                        sizeof (gint32) * 2 +
                        sizeof (gpointer) * 3);
};

void fpi_device_class_auto_initialize_features (FpDeviceClass *device_class);

/**
 * FpTimeoutFunc:
 * @device: The #FpDevice passed to fpi_device_add_timeout()
 * @user_data: the data passed to fpi_device_add_timeout()
 *
 * The prototype of the callback function for fpi_device_add_timeout().
 */
typedef void (*FpTimeoutFunc) (FpDevice *device,
                               gpointer  user_data);

/**
 * FpiDeviceAction:
 * @FPI_DEVICE_ACTION_NONE: No action is active.
 * @FPI_DEVICE_ACTION_PROBE: Probe device for support and information.
 * @FPI_DEVICE_ACTION_OPEN: Device is currently being opened.
 * @FPI_DEVICE_ACTION_CLOSE: Device is currently being closed.
 * @FPI_DEVICE_ACTION_ENROLL: Device is currently enrolling.
 * @FPI_DEVICE_ACTION_VERIFY: Device is currently verifying.
 * @FPI_DEVICE_ACTION_IDENTIFY: Device is currently identifying.
 * @FPI_DEVICE_ACTION_CAPTURE: Device is currently capturing an image.
 * @FPI_DEVICE_ACTION_LIST: Device stored prints are being queried.
 * @FPI_DEVICE_ACTION_DELETE: Device stored print is being deleted.
 * @FPI_DEVICE_ACTION_CLEAR_STORAGE: Device stored prints are being deleted.
 *
 * Current active action of the device. A driver can retrieve the action.
 */
typedef enum {
  FPI_DEVICE_ACTION_NONE = 0,
  FPI_DEVICE_ACTION_PROBE,
  FPI_DEVICE_ACTION_OPEN,
  FPI_DEVICE_ACTION_CLOSE,
  FPI_DEVICE_ACTION_ENROLL,
  FPI_DEVICE_ACTION_VERIFY,
  FPI_DEVICE_ACTION_IDENTIFY,
  FPI_DEVICE_ACTION_CAPTURE,
  FPI_DEVICE_ACTION_LIST,
  FPI_DEVICE_ACTION_DELETE,
  FPI_DEVICE_ACTION_CLEAR_STORAGE,
} FpiDeviceAction;

GUsbDevice  *fpi_device_get_usb_device (FpDevice *device);
const gchar *fpi_device_get_virtual_env (FpDevice *device);
gpointer     fpi_device_get_udev_data (FpDevice                 *device,
                                       FpiDeviceUdevSubtypeFlags subtype);
//const gchar *fpi_device_get_spi_dev (FpDevice *device);

FpiDeviceAction fpi_device_get_current_action (FpDevice *device);
gboolean fpi_device_action_is_cancelled (FpDevice *device);

GError * fpi_device_retry_new (FpDeviceRetry error);
GError * fpi_device_error_new (FpDeviceError error);

GError * fpi_device_retry_new_msg (FpDeviceRetry error,
                                   const gchar  *msg,
                                   ...) G_GNUC_PRINTF (2, 3);
GError * fpi_device_error_new_msg (FpDeviceError error,
                                   const gchar  *msg,
                                   ...) G_GNUC_PRINTF (2, 3);

guint64 fpi_device_get_driver_data (FpDevice *device);

void fpi_device_get_enroll_data (FpDevice *device,
                                 FpPrint **print);

void fpi_device_get_capture_data (FpDevice *device,
                                  gboolean *wait_for_finger);
void fpi_device_get_verify_data (FpDevice *device,
                                 FpPrint **print);
void fpi_device_get_identify_data (FpDevice   *device,
                                   GPtrArray **prints);
void fpi_device_get_delete_data (FpDevice *device,
                                 FpPrint **print);
GCancellable *fpi_device_get_cancellable (FpDevice *device);

void fpi_device_remove (FpDevice *device);

GSource * fpi_device_add_timeout (FpDevice      *device,
                                  gint           interval,
                                  FpTimeoutFunc  func,
                                  gpointer       user_data,
                                  GDestroyNotify destroy_notify);

void fpi_device_set_nr_enroll_stages (FpDevice *device,
                                      gint      enroll_stages);

void fpi_device_set_scan_type (FpDevice  *device,
                               FpScanType scan_type);

void fpi_device_update_features (FpDevice       *device,
                                 FpDeviceFeature update,
                                 FpDeviceFeature value);

void fpi_device_action_error (FpDevice *device,
                              GError   *error);

void fpi_device_critical_enter (FpDevice *device);
void fpi_device_critical_leave (FpDevice *device);

void fpi_device_probe_complete (FpDevice    *device,
                                const gchar *device_id,
                                const gchar *device_name,
                                GError      *error);
void fpi_device_open_complete (FpDevice *device,
                               GError   *error);
void fpi_device_close_complete (FpDevice *device,
                                GError   *error);
void fpi_device_enroll_complete (FpDevice *device,
                                 FpPrint  *print,
                                 GError   *error);
void fpi_device_verify_complete (FpDevice *device,
                                 GError   *error);
void fpi_device_identify_complete (FpDevice *device,
                                   GError   *error);
void fpi_device_capture_complete (FpDevice *device,
                                  FpImage  *image,
                                  GError   *error);
void fpi_device_delete_complete (FpDevice *device,
                                 GError   *error);
void fpi_device_list_complete (FpDevice  *device,
                               GPtrArray *prints,
                               GError    *error);
void fpi_device_clear_storage_complete (FpDevice *device,
                                        GError   *error);
void fpi_device_suspend_complete (FpDevice *device,
                                  GError   *error);
void fpi_device_resume_complete (FpDevice *device,
                                 GError   *error);

void fpi_device_enroll_progress (FpDevice *device,
                                 gint      completed_stages,
                                 FpPrint  *print,
                                 GError   *error);
void fpi_device_verify_report (FpDevice      *device,
                               FpiMatchResult result,
                               FpPrint       *print,
                               GError        *error);
void fpi_device_identify_report (FpDevice *device,
                                 FpPrint  *match,
                                 FpPrint  *print,
                                 GError   *error);

gboolean fpi_device_report_finger_status (FpDevice           *device,
                                          FpFingerStatusFlags finger_status);
gboolean fpi_device_report_finger_status_changes (FpDevice           *device,
                                                  FpFingerStatusFlags added_status,
                                                  FpFingerStatusFlags removed_status);

G_END_DECLS
Popax21 commented 1 year ago

That's really weird - the driver compiles fine on Arch using the latest version of libfprint-tod-git, and looking through the TOD source code FpDeviceFeature doesn't seem to have been removed / changed there either.

Can you try to reinstall libfprint-tod, and/or send the contents of /usr/include/libfprint-2/tod-1/fp-device.h if that doesn't work?

Ah sorry, it's /usr/include/libfprint-2/fp-device.h

DueJ77 commented 1 year ago
/*
 * FpDevice - A fingerprint reader device
 * Copyright (C) 2019 Benjamin Berg <bberg@redhat.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#pragma once

#include "fp-image.h"
#include <glib-object.h>
#include <gio/gio.h>

G_BEGIN_DECLS

#define FP_TYPE_DEVICE (fp_device_get_type ())
#define FP_DEVICE_RETRY (fp_device_retry_quark ())
#define FP_DEVICE_ERROR (fp_device_error_quark ())
G_DECLARE_DERIVABLE_TYPE (FpDevice, fp_device, FP, DEVICE, GObject)

#include "fp-print.h"

/* NOTE: We keep the class struct private! */

/**
 * FpDeviceType:
 * @FP_DEVICE_TYPE_VIRTUAL: The device is a virtual device
 * @FP_DEVICE_TYPE_UDEV: The device is a udev device
 * @FP_DEVICE_TYPE_USB: The device is a USB device
 */
typedef enum {
  FP_DEVICE_TYPE_VIRTUAL,
  FP_DEVICE_TYPE_USB,
  FP_DEVICE_TYPE_UDEV,
} FpDeviceType;

/**
 * FpDeviceFeature:
 * @FP_DEVICE_FEATURE_NONE: Device does not support any feature
 * @FP_DEVICE_FEATURE_CAPTURE: Supports image capture
 * @FP_DEVICE_FEATURE_VERIFY: Supports finger verification
 * @FP_DEVICE_FEATURE_IDENTIFY: Supports finger identification
 * @FP_DEVICE_FEATURE_STORAGE: Device has a persistent storage
 * @FP_DEVICE_FEATURE_STORAGE_LIST: Supports listing the storage templates
 * @FP_DEVICE_FEATURE_STORAGE_DELETE: Supports deleting stored templates
 * @FP_DEVICE_FEATURE_STORAGE_CLEAR: Supports clearing the whole storage
 * @FP_DEVICE_FEATURE_DUPLICATES_CHECK: Natively supports duplicates detection
 * @FP_DEVICE_FEATURE_ALWAYS_ON: Whether the device can run continuously
 * @FP_DEVICE_FEATURE_UPDATE_PRINT: Supports updating an existing print record using new scans
 */
typedef enum /*< flags >*/ {
  FP_DEVICE_FEATURE_NONE = 0,
  FP_DEVICE_FEATURE_CAPTURE = 1 << 0,
  FP_DEVICE_FEATURE_IDENTIFY = 1 << 1,
  FP_DEVICE_FEATURE_VERIFY = 1 << 2,
  FP_DEVICE_FEATURE_STORAGE = 1 << 3,
  FP_DEVICE_FEATURE_STORAGE_LIST = 1 << 4,
  FP_DEVICE_FEATURE_STORAGE_DELETE = 1 << 5,
  FP_DEVICE_FEATURE_STORAGE_CLEAR = 1 << 6,
  FP_DEVICE_FEATURE_DUPLICATES_CHECK = 1 << 7,
  FP_DEVICE_FEATURE_ALWAYS_ON = 1 << 8,
  FP_DEVICE_FEATURE_UPDATE_PRINT = 1 << 9,
} FpDeviceFeature;

/**
 * FpScanType:
 * @FP_SCAN_TYPE_SWIPE: Sensor requires swiping the finger.
 * @FP_SCAN_TYPE_PRESS: Sensor requires placing/pressing down the finger.
 */
typedef enum {
  FP_SCAN_TYPE_SWIPE,
  FP_SCAN_TYPE_PRESS,
} FpScanType;

/**
 * FpTemperature:
 * @FP_TEMPERATURE_COLD: Sensor is considered cold.
 * @FP_TEMPERATURE_WARM: Sensor is warm, usage time may be limited.
 * @FP_TEMPERATURE_HOT: Sensor is hot and cannot be used.
 *
 * When a device is created, it is assumed to be cold. Applications such as
 * fprintd may want to ensure all devices on the system are cold before
 * shutting down in order to ensure that the cool-off period is not violated
 * because the internal libfprint state about the device is lost.
 */
typedef enum {
  FP_TEMPERATURE_COLD,
  FP_TEMPERATURE_WARM,
  FP_TEMPERATURE_HOT,
} FpTemperature;

/**
 * FpDeviceRetry:
 * @FP_DEVICE_RETRY_GENERAL: The scan did not succeed due to poor scan quality
 *   or other general user scanning problem.
 * @FP_DEVICE_RETRY_TOO_SHORT: The scan did not succeed because the finger
 *   swipe was too short.
 * @FP_DEVICE_RETRY_CENTER_FINGER: The scan did not succeed because the finger
 *   was not centered on the scanner.
 * @FP_DEVICE_RETRY_REMOVE_FINGER: The scan did not succeed due to quality or
 *   pressure problems; the user should remove their finger from the scanner
 *   before retrying.
 *
 * Error codes representing scan failures resulting in the user needing to
 * retry.
 */
typedef enum {
  FP_DEVICE_RETRY_GENERAL,
  FP_DEVICE_RETRY_TOO_SHORT,
  FP_DEVICE_RETRY_CENTER_FINGER,
  FP_DEVICE_RETRY_REMOVE_FINGER,
} FpDeviceRetry;

/**
 * FpDeviceError:
 * @FP_DEVICE_ERROR_GENERAL: A general error occurred.
 * @FP_DEVICE_ERROR_NOT_SUPPORTED: The device does not support the requested
 *  operation.
 * @FP_DEVICE_ERROR_NOT_OPEN: The device needs to be opened to start this
 *   operation.
 * @FP_DEVICE_ERROR_ALREADY_OPEN: The device has already been opened.
 * @FP_DEVICE_ERROR_BUSY: The device is busy with another request.
 * @FP_DEVICE_ERROR_PROTO: Protocol error
 * @FP_DEVICE_ERROR_DATA_INVALID: The passed data is invalid
 * @FP_DEVICE_ERROR_DATA_NOT_FOUND: Requested print was not found on device
 * @FP_DEVICE_ERROR_DATA_FULL: No space on device available for operation
 * @FP_DEVICE_ERROR_DATA_DUPLICATE: Enrolling template duplicates storaged templates
 * @FP_DEVICE_ERROR_REMOVED: The device has been removed.
 * @FP_DEVICE_ERROR_TOO_HOT: The device might be getting too hot
 *
 * Error codes for device operations. More specific errors from other domains
 * such as #G_IO_ERROR or #G_USB_DEVICE_ERROR may also be reported.
 */
typedef enum {
  FP_DEVICE_ERROR_GENERAL,
  FP_DEVICE_ERROR_NOT_SUPPORTED,
  FP_DEVICE_ERROR_NOT_OPEN,
  FP_DEVICE_ERROR_ALREADY_OPEN,
  FP_DEVICE_ERROR_BUSY,
  FP_DEVICE_ERROR_PROTO,
  FP_DEVICE_ERROR_DATA_INVALID,
  FP_DEVICE_ERROR_DATA_NOT_FOUND,
  FP_DEVICE_ERROR_DATA_FULL,
  FP_DEVICE_ERROR_DATA_DUPLICATE,
  /* Leave some room to add more DATA related errors */
  FP_DEVICE_ERROR_REMOVED = 0x100,
  FP_DEVICE_ERROR_TOO_HOT,
} FpDeviceError;

GQuark fp_device_retry_quark (void);
GQuark fp_device_error_quark (void);

/**
 * FpEnrollProgress:
 * @device: a #FpDevice
 * @completed_stages: Number of completed stages
 * @print: (nullable) (transfer none): The last scanned print
 * @user_data: (nullable) (transfer none): User provided data
 * @error: (nullable) (transfer none): #GError or %NULL
 *
 * The passed error is guaranteed to be of type %FP_DEVICE_RETRY if set.
 */
typedef void (*FpEnrollProgress) (FpDevice *device,
                                  gint      completed_stages,
                                  FpPrint  *print,
                                  gpointer  user_data,
                                  GError   *error);

/**
 * FpMatchCb:
 * @device: a #FpDevice
 * @match: (nullable) (transfer none): The matching print if any matched @print
 * @print: (nullable) (transfer none): The newly scanned print
 * @user_data: (nullable) (transfer none): User provided data
 * @error: (nullable) (transfer none): #GError or %NULL
 *
 * Report the result of a match (identify or verify) operation.
 *
 * If @match is non-%NULL, then it is set to the matching #FpPrint as passed
 * to the match operation. In this case @error will always be %NULL.
 *
 * If @error is not %NULL then its domain is guaranteed to be
 * %FP_DEVICE_RETRY. All other error conditions will not be reported using
 * this callback. If such an error occurs before a match/no-match decision
 * can be made, then this callback will not be called. Should an error
 * happen afterwards, then you will get a match report through this callback
 * and an error when the operation finishes.
 *
 * If @match and @error are %NULL, then a finger was presented but it did not
 * match any known print.
 *
 * @print represents the newly scanned print. The driver may or may not
 * provide this information. Image based devices will provide it and it
 * allows access to the raw data.
 *
 * This callback exists because it makes sense for drivers to wait e.g. on
 * finger removal before completing the match operation. However, the
 * success/failure can often be reported at an earlier time, and there is
 * no need to make the user wait.
 */
typedef void (*FpMatchCb) (FpDevice *device,
                           FpPrint  *match,
                           FpPrint  *print,
                           gpointer  user_data,
                           GError   *error);

const gchar *fp_device_get_driver (FpDevice *device);
const gchar *fp_device_get_device_id (FpDevice *device);
const gchar *fp_device_get_name (FpDevice *device);
gboolean     fp_device_is_open (FpDevice *device);
FpScanType   fp_device_get_scan_type (FpDevice *device);
FpFingerStatusFlags fp_device_get_finger_status (FpDevice *device);
gint         fp_device_get_nr_enroll_stages (FpDevice *device);
FpTemperature fp_device_get_temperature (FpDevice *device);

FpDeviceFeature     fp_device_get_features (FpDevice *device);
gboolean            fp_device_has_feature (FpDevice       *device,
                                           FpDeviceFeature feature);

/* Opening the device */
void fp_device_open (FpDevice           *device,
                     GCancellable       *cancellable,
                     GAsyncReadyCallback callback,
                     gpointer            user_data);

void fp_device_close (FpDevice           *device,
                      GCancellable       *cancellable,
                      GAsyncReadyCallback callback,
                      gpointer            user_data);

void fp_device_suspend (FpDevice           *device,
                        GCancellable       *cancellable,
                        GAsyncReadyCallback callback,
                        gpointer            user_data);

void fp_device_resume (FpDevice           *device,
                       GCancellable       *cancellable,
                       GAsyncReadyCallback callback,
                       gpointer            user_data);

void fp_device_enroll (FpDevice           *device,
                       FpPrint            *template_print,
                       GCancellable       *cancellable,
                       FpEnrollProgress    progress_cb,
                       gpointer            progress_data,
                       GDestroyNotify      progress_destroy,
                       GAsyncReadyCallback callback,
                       gpointer            user_data);

void fp_device_verify (FpDevice           *device,
                       FpPrint            *enrolled_print,
                       GCancellable       *cancellable,
                       FpMatchCb           match_cb,
                       gpointer            match_data,
                       GDestroyNotify      match_destroy,
                       GAsyncReadyCallback callback,
                       gpointer            user_data);

void fp_device_identify (FpDevice           *device,
                         GPtrArray          *prints,
                         GCancellable       *cancellable,
                         FpMatchCb           match_cb,
                         gpointer            match_data,
                         GDestroyNotify      match_destroy,
                         GAsyncReadyCallback callback,
                         gpointer            user_data);

void fp_device_capture (FpDevice           *device,
                        gboolean            wait_for_finger,
                        GCancellable       *cancellable,
                        GAsyncReadyCallback callback,
                        gpointer            user_data);

void fp_device_delete_print (FpDevice           *device,
                             FpPrint            *enrolled_print,
                             GCancellable       *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer            user_data);

void fp_device_list_prints (FpDevice           *device,
                            GCancellable       *cancellable,
                            GAsyncReadyCallback callback,
                            gpointer            user_data);

void fp_device_clear_storage (FpDevice           *device,
                              GCancellable       *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer            user_data);

gboolean fp_device_open_finish (FpDevice     *device,
                                GAsyncResult *result,
                                GError      **error);
gboolean fp_device_close_finish (FpDevice     *device,
                                 GAsyncResult *result,
                                 GError      **error);
gboolean fp_device_suspend_finish (FpDevice     *device,
                                   GAsyncResult *result,
                                   GError      **error);
gboolean fp_device_resume_finish (FpDevice     *device,
                                  GAsyncResult *result,
                                  GError      **error);
FpPrint *fp_device_enroll_finish (FpDevice     *device,
                                  GAsyncResult *result,
                                  GError      **error);
gboolean fp_device_verify_finish (FpDevice     *device,
                                  GAsyncResult *result,
                                  gboolean     *match,
                                  FpPrint     **print,
                                  GError      **error);
gboolean fp_device_identify_finish (FpDevice     *device,
                                    GAsyncResult *result,
                                    FpPrint     **match,
                                    FpPrint     **print,
                                    GError      **error);
FpImage * fp_device_capture_finish (FpDevice     *device,
                                    GAsyncResult *result,
                                    GError      **error);
gboolean fp_device_delete_print_finish (FpDevice     *device,
                                        GAsyncResult *result,
                                        GError      **error);
GPtrArray * fp_device_list_prints_finish (FpDevice     *device,
                                          GAsyncResult *result,
                                          GError      **error);
gboolean fp_device_clear_storage_finish (FpDevice     *device,
                                         GAsyncResult *result,
                                         GError      **error);

gboolean fp_device_open_sync (FpDevice     *device,
                              GCancellable *cancellable,
                              GError      **error);
gboolean fp_device_close_sync (FpDevice     *device,
                               GCancellable *cancellable,
                               GError      **error);
FpPrint * fp_device_enroll_sync (FpDevice        *device,
                                 FpPrint         *template_print,
                                 GCancellable    *cancellable,
                                 FpEnrollProgress progress_cb,
                                 gpointer         progress_data,
                                 GError         **error);
gboolean fp_device_verify_sync (FpDevice     *device,
                                FpPrint      *enrolled_print,
                                GCancellable *cancellable,
                                FpMatchCb     match_cb,
                                gpointer      match_data,
                                gboolean     *match,
                                FpPrint     **print,
                                GError      **error);
gboolean fp_device_identify_sync (FpDevice     *device,
                                  GPtrArray    *prints,
                                  GCancellable *cancellable,
                                  FpMatchCb     match_cb,
                                  gpointer      match_data,
                                  FpPrint     **match,
                                  FpPrint     **print,
                                  GError      **error);
FpImage * fp_device_capture_sync (FpDevice     *device,
                                  gboolean      wait_for_finger,
                                  GCancellable *cancellable,
                                  GError      **error);
gboolean fp_device_delete_print_sync (FpDevice     *device,
                                      FpPrint      *enrolled_print,
                                      GCancellable *cancellable,
                                      GError      **error);
GPtrArray * fp_device_list_prints_sync (FpDevice     *device,
                                        GCancellable *cancellable,
                                        GError      **error);
gboolean fp_device_clear_storage_sync (FpDevice     *device,
                                       GCancellable *cancellable,
                                       GError      **error);
gboolean fp_device_suspend_sync (FpDevice     *device,
                                 GCancellable *cancellable,
                                 GError      **error);
gboolean fp_device_resume_sync (FpDevice     *device,
                                GCancellable *cancellable,
                                GError      **error);

/* Deprecated functions */
G_DEPRECATED_FOR (fp_device_get_features)
gboolean     fp_device_supports_identify (FpDevice *device);
G_DEPRECATED_FOR (fp_device_get_features)
gboolean     fp_device_supports_capture (FpDevice *device);
G_DEPRECATED_FOR (fp_device_get_features)
gboolean     fp_device_has_storage (FpDevice *device);

G_END_DECLS
Popax21 commented 1 year ago

This is getting increasingly weirder, the files are in the exact layout they should be, yet it still somehow doesn't pick up the enum definition.

Can you try to run gcc -E $(pkg-config --cflags glib-2.0 libfprint-2 libfprint-2-tod-1 gusb) libfprint-tod/src/device.h | grep FpDeviceFeature inside of the project directory?

DueJ77 commented 1 year ago

Can you try to run gcc -E $(pkg-config --cflags glib-2.0 libfprint-2 libfprint-2-tod-1 gusb) libfprint-tod/src/device.h | grep FpDeviceFeature inside of the project directory?

It returns:

  FpDeviceFeature features;
  char _tod_expansion_padding[(8 * (32)) - ((sizeof (FpDeviceFeature) + sizeof (gint32) * 2 + sizeof (gpointer) * 3) + (8 == 8 ? 8 : 0))];
                                 FpDeviceFeature update,
                                 FpDeviceFeature value);
Popax21 commented 1 year ago

It should have returned

} FpDeviceFeature;
FpDeviceFeature fp_device_get_features (FpDevice *device);
                                           FpDeviceFeature feature);
  FpDeviceFeature features;

as well, so I'm getting increasingly confused.

Can you attach the contents of /usr/include/libfprint-2/tod-1/drivers_api.h, as well as the output of pkg-config --cflags libfprint-2 libfprint-2-tod-1?

DueJ77 commented 1 year ago

cat /usr/include/libfprint-2/tod-1/drivers_api.h:

/*
 * Driver API definitions
 * Copyright (C) 2007-2008 Daniel Drake <dsd@gentoo.org>
 * Copyright (C) 2018 Bastien Nocera <hadess@hadess.net>
 * Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#pragma once

#include "fpi-compat.h"
#include "fpi-assembling.h"
#include "fpi-device.h"
#include "fpi-image-device.h"
#include "fpi-image.h"
#include "fpi-log.h"
#include "fpi-print.h"
#include "fpi-usb-transfer.h"
#include "fpi-spi-transfer.h"
#include "fpi-ssm.h"

pkg-config --cflags libfprint-2 libfprint-2-tod-1: -pthread -I/usr/local/include/libfprint-2 -I/usr/include/libfprint-2/tod-1 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include

Popax21 commented 1 year ago

gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/tod-1/drivers_api.h | grep FpDeviceFeature?

DueJ77 commented 1 year ago
/usr/include/libfprint-2/tod-1/drivers_api.h:22:9: warning: #pragma once in main file
   22 | #pragma once
      |         ^~~~
  FpDeviceFeature features;
  char _tod_expansion_padding[(8 * (32)) - ((sizeof (FpDeviceFeature) + sizeof (gint32) * 2 + sizeof (gpointer) * 3) + (8 == 8 ? 8 : 0))];
                                 FpDeviceFeature update,
                                 FpDeviceFeature value);
Popax21 commented 1 year ago

This is incredibly weird...

What about gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/tod-1/fpi-device.h | grep FpDeviceFeature and gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/fp-device.h | grep FpDeviceFeature?

DueJ77 commented 1 year ago

gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/tod-1/fpi-device.h | grep FpDeviceFeature:

/usr/include/libfprint-2/tod-1/fpi-device.h:20:9: warning: #pragma once in main file
   20 | #pragma once
      |         ^~~~
  FpDeviceFeature features;
  char _tod_expansion_padding[(8 * (32)) - ((sizeof (FpDeviceFeature) + sizeof (gint32) * 2 + sizeof (gpointer) * 3) + (8 == 8 ? 8 : 0))];
                                 FpDeviceFeature update,
                                 FpDeviceFeature value);

gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/fp-device.h | grep FpDeviceFeature:

/usr/include/libfprint-2/fp-device.h:21:9: warning: #pragma once in main file
   21 | #pragma once
      |         ^~~~
} FpDeviceFeature;
FpDeviceFeature fp_device_get_features (FpDevice *device);
                                           FpDeviceFeature feature);
Popax21 commented 1 year ago

We might be dealing with a compiler issue here - fpi-device.h includes fp-device.h (both in the source tree and in the version you posted), yet gcc doesn't seem to do so, as it doesn't include the bits of fp-device.h which matter in the output.

What's you GCC version? (gcc --version)

DueJ77 commented 1 year ago

gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0

Popax21 commented 1 year ago

Can you send the raw output of gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/tod-1/fpi-device.h? (note that it might be huge, so it's best if you attach it as a separate file)

DueJ77 commented 1 year ago

output.txt

Popax21 commented 1 year ago

I have no clue what's going on anymore...

FpDeviceType is included in the log, so is FpScanType, which is directly after FpDeviceFeature, but FpDeviceFeature itself isn't???

I'm gonna take a shot in the dark now: in fp-device.h, FpDeviceFeature is defined using the line typedef enum /*< flags >*/ {. Can you try to remove the comment from that line, and see if gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/tod-1/fpi-device.h | grep FpDeviceFeature's output changes?

DueJ77 commented 1 year ago

I removed the comment. The output of gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/tod-1/fpi-device.h | grep FpDeviceFeature is:

/usr/include/libfprint-2/tod-1/fpi-device.h:20:9: warning: #pragma once in main file
   20 | #pragma once
      |         ^~~~
  FpDeviceFeature features;
  char _tod_expansion_padding[(8 * (32)) - ((sizeof (FpDeviceFeature) + sizeof (gint32) * 2 + sizeof (gpointer) * 3) + (8 == 8 ? 8 : 0))];
                                 FpDeviceFeature update,
                                 FpDeviceFeature value);

So it's the same as before.

Popax21 commented 1 year ago

I removed the comment. The output of gcc -E $(pkg-config --cflags libfprint-2 libfprint-2-tod-1 gusb) /usr/include/libfprint-2/tod-1/fpi-device.h | grep FpDeviceFeature is:

/usr/include/libfprint-2/tod-1/fpi-device.h:20:9: warning: #pragma once in main file
   20 | #pragma once
      |         ^~~~
  FpDeviceFeature features;
  char _tod_expansion_padding[(8 * (32)) - ((sizeof (FpDeviceFeature) + sizeof (gint32) * 2 + sizeof (gpointer) * 3) + (8 == 8 ? 8 : 0))];
                                 FpDeviceFeature update,
                                 FpDeviceFeature value);

So it's the same as before.

I know that this might be a bit much to ask, but would it be a big hassle if you could try to compile the project in either a VM, or on a live USB? I have a suspicion that this issue might be that your install is screwed up in some way, or a Ubuntu-specific compiler bug.

DueJ77 commented 1 year ago

I can try on another computer with 06cb:00be.

DueJ77 commented 1 year ago

Tried on another computer with ubuntu 22.04. There it runs without errors. So the issue is in my install, because I had the error already before upgrade from 22.04 to 22.10. Do you have any idea, where I can search for the problem?

Popax21 commented 1 year ago

Tried on another computer with ubuntu 22.04. There it runs without errors. So the issue is in my install, because I had the error already before upgrade from 22.04 to 22.10. Do you have any idea, where I can search for the problem?

Honestly this sounds like some file corruption thing or so, you might want try to reinstall the compiler, but I would also take precautions against disk failure.

DueJ77 commented 1 year ago

Thank you very much. Fixed it now by searching for libfprint in my full filesystem and deleting old files (before October). Then reinstalled all libfprint-2 packages.