If you want modules working with 2.6.24-18 you should build 2.6.24-18. Modules from 2.6.24-12 worked only up to 2.6.24-16.
If you want modules working with 2.6.24-18 you should build 2.6.24-18.
Modules from 2.6.24-12 worked only up to 2.6.24-16.