LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-25-2012, 02:53 AM   #1
Blaider
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled
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!
 
Old 12-27-2012, 03:06 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,125

Rep: Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260
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.
 
Old 12-28-2012, 11:37 PM   #3
Deep Narayan Dubey
LQ Newbie
 
Registered: Dec 2010
Location: Allahabad, India
Posts: 11

Rep: Reputation: 8
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.
 
Old 04-02-2014, 02:40 AM   #4
Blaider
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined reference to `__this_module' when trying to link module to kernel Rostfrei Linux - General 1 04-02-2014 02:43 AM
undefined reference to... dimah Programming 3 12-27-2006 09:57 AM
Undefined reference to: ashlesha Programming 5 11-08-2006 01:07 PM
undefined reference? Sharky01252 Programming 3 11-07-2006 11:36 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration