-   Linux - Kernel (
-   -   undefined reference to `__this_module (

Blaider 12-25-2012 03:53 AM

undefined reference to `__this_module
when I add my PCI driver to the kernel.
I build my driver as module it's ok.but when I want to build it into the shows errors as flow:

drivers/built-in.o(.init.text+0x52c4): undefined reference to `__this_module

what should I do to avoid the error!

smallpond 12-27-2012 04:06 PM

insmod defines that value during loading. If you build it into the kernel it is not defined because you do not have a "struct module" which it points to.

Deep Narayan Dubey 12-29-2012 12:37 AM

Did you change makefile to include your new module as build target? If yes, please give the details of Makefile and directory structure for module.

Blaider 04-02-2014 03:40 AM

my colleague has defined "#define MODULE" in the header can build into the kernel correctly when I remove this code,
thanks every one here!

All times are GMT -5. The time now is 10:58 AM.