Hi -
1. It doesn't, of course, matter where you build your module.
2. It matters very much, however, that a kernel module be specially built *as* a kernel module. Here is a link on compiling kernel modules:
http://www.faqs.org/docs/kernel/x204.html
3. It's also essential that you *not* call user-space runtime library functions (like "printf()") from a kernel module.