LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-26-2005, 07:41 AM   #1
okeyla
Member
 
Registered: Nov 2004
Posts: 47

Rep: Reputation: 15
Oreilly's linux device driver example code...


I have Oreilly's "Linux Device Driver" 2nd and 3rd version example codes.
But I cannot compile both of them successfully.
(They seems just enter their directory and make...)
Could anyone tell me how to make it?

thanks!
 
Old 04-26-2005, 12:14 PM   #2
JonahRowley
LQ Newbie
 
Registered: Apr 2005
Posts: 4

Rep: Reputation: 0
It would help if you paste the error messages you're getting. Make sure you have GCC and your kernel headers, and you should be all set though.
 
Old 04-27-2005, 04:58 AM   #3
okeyla
Member
 
Registered: Nov 2004
Posts: 47

Original Poster
Rep: Reputation: 15
Please give me a hand.
Thank you.

The Linux Device Driver 2nd version (for 2.4.X ) example compile error:

for n in misc-progs misc-modules skull scull scullc scullp scullv sbull spull snull short shortprint pci simple usb allocator; do make -C $n || exit 1; done
make[1]: Entering directory `/usr/src/linux-2.4.20-8/drivers/ldd2-samples-1.0.1/misc-progs'
cc -O2 -fomit-frame-pointer -Wall -I/usr/include setlevel.c -o setlevel
/tmp/cc2L3MPN.o(.text+0x1c): In function `syslog':
: undefined reference to `errno'
/tmp/cc2L3MPN.o(.text+0x89): In function `main':
: undefined reference to `errno'
collect2: ld returned 1 exit status
make[1]: *** [setlevel] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.20-8/drivers/ldd2-samples-1.0.1/misc-progs'
make: *** [subdirs] Error 1


The Linux Device Driver 3rd version (for 2.6.X ) example compile error:

[root@localhost examples]# make
for n in misc-progs misc-modules skull scull scullc sculld scullp scullv sbull snull short shortprint pci simple usb tty lddbus; do make -C $n || exit 1; done
make[1]: Entering directory `/root/TEST/examples/misc-progs'
cc -O2 -fomit-frame-pointer -Wall -I/lib/modules/2.6.5-1.358/build/include inp.c -o inp
In file included from /lib/modules/2.6.5-1.358/build/include/asm/io.h:4,
from inp.c:33:
/lib/modules/2.6.5-1.358/build/include/linux/config.h:6:2: #error including kernel header in userspace; use the glibc headers instead!
make[1]: *** [inp] Error 1
make[1]: Leaving directory `/root/TEST/examples/misc-progs'
make: *** [subdirs] Error 1
 
  


Reply



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
C++ or pure C for Linux kernel module, Linux device driver development. What to use? Igor007 Programming 91 07-19-2014 11:55 AM
Linux Device Driver malacma Linux - Software 10 10-09-2007 06:14 AM
Where can i find the device driver code on my systeM dr_zayus69 Linux - Hardware 1 10-02-2005 04:59 AM
Device driver code ar1 Programming 2 05-13-2005 08:20 AM
Info about Linux Device Driver rajatnaik Linux - Software 2 07-28-2003 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:46 AM.

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