LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   undefined reference to `__this_module (http://www.linuxquestions.org/questions/linux-kernel-70/undefined-reference-to-%60__this_module-4175442868/)

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 kernel.it shows errors as flow:

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

what should I do to avoid the error!
thx!

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 file.it can build into the kernel correctly when I remove this code,
thanks every one here!


All times are GMT -5. The time now is 09:33 AM.