LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-09-2006, 01:56 PM   #1
kesher
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
Undefined errno reference while compiling loadable module


I think I'm gonna kill myself. This is so stupid... Of course I've looked for a solution all over the net and beyond. No luck, except for the fact that it could be somehow related to linux/unistd.h. I've modified such file and no luck again.

I make NO USE of errno in my code.


Here is my Makefile:


Quote:
o
Code:
bj-m += deiso.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

Here is the make output:



Quote:
Code:
make -C /lib/modules/2.6.12-9-386/build M=/home/kesher/proyectos/deiso modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.12-9-386'
CC [M] /home/kesher/proyectos/deiso/deiso.o
Building modules, stage 2.
MODPOST
*** Warning: "errno" [/home/kesher/proyectos/deiso/deiso.ko] undefined!
CC /home/kesher/proyectos/deiso/deiso.mod.o
LD [M] /home/kesher/proyectos/deiso/deiso.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.12-9-386'



And of course insmod refuses to load deiso.ko because of the undefined reference.

Any help appreciated

THANKS
 
Old 04-09-2006, 02:50 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
try
#include <errno.h>
 
Old 04-09-2006, 02:53 PM   #3
kesher
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by foo_bar_foo
try
#include <errno.h>
I have included linux/errno.h (but I don't use it), and it doesn't work. I can't include userspace libraries in a module, anyway.
 
Old 04-10-2006, 01:22 AM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
yea you are right it should be <linux/errno.h>
please forgive as i bat about more non helpfull things
but the real thing that bothers me is
Code:
Entering directory `/usr/src/linux-headers-2.6.12-9-386'
might be a distribution thing but
the only thing i know with the word headers in it is
userspace Linux-Libc-Headers
/lib/modules/`uname -r` needs to be the actual directory used to compile your currently running kernel
almost always just named linux-x.y.x unless you changed its name for some reason
 
  


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 WxGtk libraries when compiling Xchm Darwish Linux - Software 0 09-03-2005 11:11 PM
undefined reference to `cfb_fillrect' and more when compiling kernel KR-data Linux - Software 0 09-03-2005 01:56 PM
subject: undefined reference to errno ashi_sheetal Programming 0 01-04-2005 06:12 AM
undefined reference to 'errno' kbridger Programming 2 10-07-2003 05:44 PM
Mysql install error in RH9 -undefined reference to errno murugesan_n Linux - Software 0 09-09-2003 10:12 AM

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

All times are GMT -5. The time now is 06:48 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