Zaptel 1.4.x/Linux 2.4.18: couldn't find the kernel version

This is a continuation of forums.digium.com/viewtopic.php? … highlight=“couldn’t find the kernel version the module was compiled for”.

I got this error

# modprobe zaptel /lib/modules/2.4.18-19.7.x/misc/zaptel.o: couldn't find the kernel version the module was compiled for
after compiling zaptel 1.4.0 under 2.4.18-19.7.x kernel, gcc (GCC) 3.4.1, GNU Make 3.81.

I settled with using zaptel 1.2.x with Asterisk 1.4.0 at the time. Now that zaptel 1.4.1 is out and I wanted to try my luck. No luck. zaptel 1.4.1 has exactly the same problem. After lots of tinkering, Google led me to this article linuxdocs.org/HOWTOs/Module-HOWTO/x150.html in Module Howto, that says

This means that zaptel 1.4.x release can’t make an LKM under my system. Anyone else having this problem?

Indeed, whereas a successfully compiled 1.2.x zaptel.o contains sections indicating, e.g., kernel_version=2.4.18-19.7.x., the object file compiled from zaptel 1.4.x doesn’t.