Re: errors compiling scull from Linux Device Drivers book

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



change /usr/src/linux-2.4 to what u r using or
do a symlink of ur kernel directory to linux-2.4
or rename your kernel directory to linux-2.4

Eugene

<quote sender="William J. Beksi">
> I'm new to kernel programming and am trying to get the example device 
> driver "scull" from Linux Device Drivers working. I downloaded the example 
> code from here: http://examples.oreilly.com/linuxdrive2/
> 
> I'm running Redhat linux with kernel 2.4.20-8. The output from running 
> gmake is below. Any help would be greatly appreciated.
> 
> thank you,
> Bill
> 
> 
> 
> wbeksi@asahi:~/programs/drivers/scull$ gmake scull
> gcc -Wall -D__KERNEL__ -DMODULE -I/usr/src/linux-2.4/include  -O2 -I..   -c 
> -o main.o main.c
> gcc -Wall -D__KERNEL__ -DMODULE -I/usr/src/linux-2.4/include  -O2 -I..   -c 
> -o pipe.o pipe.c
> pipe.c: In function `scull_p_read':
> pipe.c:155: warning: comparison of distinct pointer types lacks a cast
> pipe.c:157: warning: comparison of distinct pointer types lacks a cast
> pipe.c: In function `scull_p_write':
> pipe.c:202: warning: comparison of distinct pointer types lacks a cast
> pipe.c:204: warning: comparison of distinct pointer types lacks a cast
> pipe.c:206: warning: comparison of distinct pointer types lacks a cast
> gcc -Wall -D__KERNEL__ -DMODULE -I/usr/src/linux-2.4/include  -O2 -I..   -c 
> -o access.o access.c
> ld -r main.o pipe.o access.o -o scull.o
> gcc   scull.o   -o scull
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18): In 
> function `_start':
> ../sysdeps/i386/elf/start.S:77: undefined reference to `main'
> scull.o(.text+0x3a): In function `scull_trim':
> : undefined reference to `kfree'
> scull.o(.text+0x54): In function `scull_trim':
> : undefined reference to `kfree'
> scull.o(.text+0x91): In function `scull_trim':
> : undefined reference to `kfree'
> scull.o(.text+0x1f0): In function `scull_create_proc':
> : undefined reference to `create_proc_entry'
> scull.o(.text+0x21a): In function `scull_remove_proc':
> : undefined reference to `remove_proc_entry'
> scull.o(.text+0x278): In function `scull_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x284): In function `scull_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x2a6): In function `scull_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x2ac): In function `scull_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x305): In function `scull_release':
> : undefined reference to `__this_module'
> scull.o(.text+0x30b): more undefined references to `__this_module' follow
> scull.o(.text+0x34b): In function `scull_follow':
> : undefined reference to `kmalloc'
> scull.o(.text+0x44f): In function `scull_read':
> : undefined reference to `__generic_copy_to_user'
> scull.o(.text+0x556): In function `scull_write':
> : undefined reference to `__generic_copy_from_user'
> scull.o(.text+0x5b8): In function `scull_write':
> : undefined reference to `kmalloc'
> scull.o(.text+0x5e7): In function `scull_write':
> : undefined reference to `kmalloc'
> scull.o(.text+0x8a2): In function `scull_ioctl':
> : undefined reference to `__this_module'
> scull.o(.text+0x8ac): In function `scull_ioctl':
> : undefined reference to `__this_module'
> scull.o(.text+0x8b5): In function `scull_ioctl':
> : undefined reference to `__this_module'
> scull.o(.text+0x8bf): In function `scull_ioctl':
> : undefined reference to `__this_module'
> scull.o(.text+0x8c5): In function `scull_ioctl':
> : undefined reference to `__this_module'
> scull.o(.text+0x8ce): more undefined references to `__this_module' follow
> scull.o(.text+0xaf8): In function `scull_cleanup_module':
> : undefined reference to `unregister_chrdev'
> scull.o(.text+0xb4a): In function `scull_cleanup_module':
> : undefined reference to `kfree'
> scull.o(.text+0xb83): In function `init_module':
> : undefined reference to `__this_module'
> scull.o(.text+0xb88): In function `init_module':
> : undefined reference to `register_chrdev'
> scull.o(.text+0xbc0): In function `init_module':
> : undefined reference to `kmalloc'
> scull.o(.text+0xc82): In function `init_module':
> : undefined reference to `printk'
> scull.o(.text+0xd10): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0xd1a): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0xd24): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0xd2e): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0xd38): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0xd42): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0xd4c): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0xd56): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0xe0f): In function `scull_p_open':
> : undefined reference to `__this_module'
> scull.o(.text+0xe15): In function `scull_p_open':
> : undefined reference to `__this_module'
> scull.o(.text+0xe33): In function `scull_p_open':
> : undefined reference to `kmalloc'
> scull.o(.text+0xebd): In function `scull_p_release':
> : undefined reference to `__this_module'
> scull.o(.text+0xec3): In function `scull_p_release':
> : undefined reference to `__this_module'
> scull.o(.text+0xedb): In function `scull_p_release':
> : undefined reference to `kfree'
> scull.o(.text+0xf56): In function `scull_p_read':
> : undefined reference to `__generic_copy_to_user'
> scull.o(.text+0xf9a): In function `scull_p_read':
> : undefined reference to `__wake_up'
> scull.o(.text+0x102b): In function `scull_p_read':
> : undefined reference to `add_wait_queue'
> scull.o(.text+0x104a): In function `scull_p_read':
> : undefined reference to `schedule'
> scull.o(.text+0x1066): In function `scull_p_read':
> : undefined reference to `remove_wait_queue'
> scull.o(.text+0x1172): In function `scull_p_write':
> : undefined reference to `add_wait_queue'
> scull.o(.text+0x11ac): In function `scull_p_write':
> : undefined reference to `schedule'
> scull.o(.text+0x11c9): In function `scull_p_write':
> : undefined reference to `remove_wait_queue'
> scull.o(.text+0x122f): In function `scull_p_write':
> : undefined reference to `__generic_copy_from_user'
> scull.o(.text+0x1277): In function `scull_p_write':
> : undefined reference to `__wake_up'
> scull.o(.text+0x1297): In function `scull_p_write':
> : undefined reference to `kill_fasync'
> scull.o(.text+0x12f4): In function `scull_p_poll':
> : undefined reference to `__pollwait'
> scull.o(.text+0x130d): In function `scull_p_poll':
> : undefined reference to `__pollwait'
> scull.o(.text+0x1350): In function `scull_p_fasync':
> : undefined reference to `fasync_helper'
> scull.o(.text+0x138c): In function `scull_p_init':
> : undefined reference to `__this_module'
> scull.o(.text+0x1391): In function `scull_p_init':
> : undefined reference to `kmalloc'
> scull.o(.text+0x145a): In function `scull_p_cleanup':
> : undefined reference to `kfree'
> scull.o(.text+0x1475): In function `scull_p_cleanup':
> : undefined reference to `kfree'
> scull.o(.text+0x1485): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0x148f): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x1499): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x14a3): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed'
> scull.o(.text+0x14ad): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x14b7): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0x14c1): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x14cb): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x14d5): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x14df): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0x14e9): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0x14f3): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x14fd): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__down_failed_interruptible'
> scull.o(.text+0x1507): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x1511): In function `.text.lock.KBUILD_BASENAME':
> : undefined reference to `__up_wakeup'
> scull.o(.text+0x1578): In function `scull_s_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x157e): In function `scull_s_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x15a7): In function `scull_s_release':
> : undefined reference to `__this_module'
> scull.o(.text+0x15ad): In function `scull_s_release':
> : undefined reference to `__this_module'
> scull.o(.text+0x165e): In function `scull_u_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x1664): more undefined references to `__this_module' follow
> scull.o(.text+0x1730): In function `scull_w_open':
> : undefined reference to `interruptible_sleep_on'
> scull.o(.text+0x1780): In function `scull_w_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x1786): In function `scull_w_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x17c3): In function `scull_w_release':
> : undefined reference to `__this_module'
> scull.o(.text+0x17c9): In function `scull_w_release':
> : undefined reference to `__this_module'
> scull.o(.text+0x17e4): In function `scull_w_release':
> : undefined reference to `__wake_up'
> scull.o(.text+0x1830): In function `scull_c_lookfor_device':
> : undefined reference to `kmalloc'
> scull.o(.text+0x18f6): In function `scull_c_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x18fc): In function `scull_c_open':
> : undefined reference to `__this_module'
> scull.o(.text+0x1919): In function `scull_c_release':
> : undefined reference to `__this_module'
> scull.o(.text+0x191f): In function `scull_c_release':
> : undefined reference to `__this_module'
> scull.o(.text+0x19d8): In function `scull_access_init':
> : undefined reference to `__this_module'
> scull.o(.text+0x19e2): more undefined references to `__this_module' follow
> scull.o(.text+0x1a51): In function `scull_access_cleanup':
> : undefined reference to `kfree'
> scull.o(.text+0x1a6a): In function `scull_access_cleanup':
> : undefined reference to `kfree'
> scull.o(.data+0x24): undefined reference to `scull_wuser_fops'
> collect2: ld returned 1 exit status
> gmake: *** [scull] Error 1
> 
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
> http://join.msn.com/?page=features/junkmail
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux