在编译module生成.ko目标文件是出错,提示如下:
src/sndshield.c:2042: error: variable `__this_module' has initializer but incomplete type
src/sndshield.c:2043: error: unknown field `name' specified in initializer
src/sndshield.c:2043: warning: excess elements in struct initializer
src/sndshield.c:2043: warning: (near initialization for `__this_module')
src/sndshield.c:2044: error: unknown field `init' specified in initializer
src/sndshield.c:2044: warning: excess elements in struct initializer
src/sndshield.c:2044: warning: (near initialization for `__this_module')
src/sndshield.c:2042: error: storage size of `__this_module' isn't known
解决方法:
make ARCH=YOUR_ARCH CROSS_COMPILE=YOUR_CROSSCOMPILE menuconfig
[*] Enable loadable module support
[*] Module unloading (not necessary, but very useful)
保存更改后再编译,就没错了。