I found out from https://github.com/aircrack-ng/rtl8812au/issues/933 that rpi-source does not support 64-bit kernels.
I was able to compile the module properly by using the rpi-source from https://github.com/RPi-Distro/rpi-source/pull/2.
Since that was not merged, and the issue still persists, and to give more visibility to anyone who might face the same thing, I open this issue here.
It might be worthwhile to indicate in README.md that rpi-source does not support 64-bit kernels.
I had trouble compiling a kernel module with errors along these lines:
I found out from https://github.com/aircrack-ng/rtl8812au/issues/933 that rpi-source does not support 64-bit kernels. I was able to compile the module properly by using the rpi-source from https://github.com/RPi-Distro/rpi-source/pull/2. Since that was not merged, and the issue still persists, and to give more visibility to anyone who might face the same thing, I open this issue here. It might be worthwhile to indicate in README.md that rpi-source does not support 64-bit kernels.