markbolhuis / hideizo

Linux HID device driver for EIZO EV FlexScan monitors
GNU General Public License v2.0
26 stars 3 forks source link

Compilation Errors and Warnings in `eizo.c` on arch, FlexScan EV2360 #8

Open jhp-1 opened 2 months ago

jhp-1 commented 2 months ago

Hi,

I'm trying to get this working on my monitor but I have little to no experience with C or with modules, so I have not made it very far. Looking at markbolhuis/hideizo#3, I have cloned the repo and got the following errors during compilation.

When I run the command:

make -C /lib/modules/`uname -r`/build M=$('pwd') modules

I get the following output:

make: Entering directory '/usr/lib/modules/6.9.5-arch1-1/build'
  CC [M]  /home/joe/.local/share/hideizo/./src/eizo.o
/home/joe/.local/share/hideizo/./src/eizo.c:17:5: warning: no previous prototype for ‘eizo_verify’ [-Wmissing-prototypes]
   17 | int eizo_verify(struct hid_device *hdev, u32 usage) {
      |     ^~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:59:5: warning: no previous prototype for ‘eizo_set_value’ [-Wmissing-prototypes]
   59 | int eizo_set_value(struct hid_device *hdev, u32 usage, u8 *value, size_t value_len) {
      |     ^~~~~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:110:5: warning: no previous prototype for ‘eizo_get_value’ [-Wmissing-prototypes]
  110 | int eizo_get_value(struct hid_device *hdev, u32 usage, u8 *value, size_t value_len) {
      |     ^~~~~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:175:5: warning: no previous prototype for ‘eizo_get_counter’ [-Wmissing-prototypes]
  175 | int eizo_get_counter(struct hid_device *hdev) {
      |     ^~~~~~~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:200:5: warning: no previous prototype for ‘eizo_get_sn_model’ [-Wmissing-prototypes]
  200 | int eizo_get_sn_model(struct hid_device *hdev) {
      |     ^~~~~~~~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:234:5: warning: no previous prototype for ‘eizo_get_usage_from_report’ [-Wmissing-prototypes]
  234 | u32 eizo_get_usage_from_report(struct hid_report *report) {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:245:20: warning: no previous prototype for ‘eizo_get_report_from_usage’ [-Wmissing-prototypes]
  245 | struct hid_report *eizo_get_report_from_usage(struct hid_device *hdev, int type, u32 usage) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:464:5: warning: no previous prototype for ‘eizo_create_hid_device’ [-Wmissing-prototypes]
  464 | int eizo_create_hid_device(struct hid_device *hdev) {
      |     ^~~~~~~~~~~~~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c: In function ‘eizo_create_hid_device’:
/home/joe/.local/share/hideizo/./src/eizo.c:490:5: error: implicit declaration of function ‘strlcpy’; did you mean ‘strncpy’? [-Wimplicit-function-declaration]
  490 |     strlcpy(vdev->phys, dev_name(&hdev->dev), sizeof(vdev->phys));
      |     ^~~~~~~
      |     strncpy
/home/joe/.local/share/hideizo/./src/eizo.c: At top level:
/home/joe/.local/share/hideizo/./src/eizo.c:507:5: warning: no previous prototype for ‘eizo_init’ [-Wmissing-prototypes]
  507 | int eizo_init(struct hid_device *hdev) {
      |     ^~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:535:6: warning: no previous prototype for ‘eizo_uninit’ [-Wmissing-prototypes]
  535 | void eizo_uninit(struct hid_device *hdev) {
      |      ^~~~~~~~~~~
/home/joe/.local/share/hideizo/./src/eizo.c:598:5: warning: no previous prototype for ‘eizo_report_get_event’ [-Wmissing-prototypes]
  598 | int eizo_report_get_event(struct hid_device *child, struct hid_report *report, u8 *data, int size) {
      |     ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:244: /home/joe/.local/share/hideizo/./src/eizo.o] Error 1
make[1]: *** [/usr/lib/modules/6.9.5-arch1-1/build/Makefile:1918: /home/joe/.local/share/hideizo] Error 2
make: *** [Makefile:240: __sub-make] Error 2
make: Leaving directory '/usr/lib/modules/6.9.5-arch1-1/build'

Any help would be appreciated, and please let me know if I've done something silly :)

geraldraaf commented 1 month ago

i don't know ubuntu very well, i think you don't have libhidapi files on your machine. There is a package package called hidapi this package installs libhidapi-dev libhidapi-hidraw0 and libhidapi-libusb0

markbolhuis commented 1 month ago

You don't need libhidapi to compile this.

I run arch as well and it It should be enough to do:

make
make load