I installed the latest version of raspios, here is the uname -a Linux raspberrypi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux

I git cloned V4l2loopback and tried compiling after getting the linux headers. I get the following error.

Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/pi/v4l2loopback KCPPFLAGS="-DSNAPSHOT_VERSION='"0.12.7-412-g850a2e3"'" modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.21+'
  CC [M]  /home/pi/v4l2loopback/v4l2loopback.o
  MODPOST /home/pi/v4l2loopback/Module.symvers
ERROR: modpost: "__aeabi_ldivmod" [/home/pi/v4l2loopback/v4l2loopback.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:126: /home/pi/v4l2loopback/Module.symvers] Error 1
make[1]: *** [Makefile:1964: modpost] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.21+'
make: *** [Makefile:53: v4l2loopback.ko] Error 2

I googled and found that is error mostly shows up when you do 64 bit division on 32 bit. I looked through the code and found instances of divisions with 64 bit and I tried to replace it with do_div() but to no avail. I get a whole bunch of other errors when I do that. How do you fix this issue?


1 Answer 1


you're probably compiling for the wrong target machine. Impossible to tell what specifically you're doing, whether you're cross-compiling this, or how you're compiling this on the RPi, and what exactly you've done to "get the linux headers".


You shouldn't have to build that manually, it's packaged by debian and should hence be available, at the very least, through the v4l2loopback-dmks package.

  • Thanks for the quick answer. I was compiling on Raspberry Pi Zero for deploying on a Zero. I installed the headers using sudo apt install raspberrypi-kernel-header. Anyway, thanks for letting me know that I can install the module directly with no compiling necessary. Appreciate it
    – Anil
    Dec 13, 2023 at 20:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .