vi / virtual_touchscreen

Simple evdev linux device driver and GUI program to simulate multitouch touchscreen
90 stars 33 forks source link

Compiler error on Ubuntu 23, also added the solution #11

Open kurdibogdan opened 2 months ago

kurdibogdan commented 2 months ago

When I try to run make command, I get an error:

... virtual_touchscreen/virtual_touchscreen.c: In function ‘virt_ts_init’: ./include/linux/init.h:184:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] 184 #define THIS_MODULE (&__this_module) ~^~~~~~~
struct module *

... virtual_touchscreen.c:77:23: note: in expansion of macro ‘THIS_MODULE’ 77 | cl = class_create(THIS_MODULE, DEVICE_NAME); ./include/linux/device/class.h:228:54: note: expected ‘const char ’ but argument is of type ‘struct module

I could solve this issue by removing the first argument of the class_create function so: 77 | cl = class_create(DEVICE_NAME);

And the make runs perfectly, creates the .ko file that I needed.