Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i tried to compile module hello.c in linux 3.2.0-23-generic..
the error with btusb.c arrised. how to fix this error..i don't no kernel programming..
Code:
root@ubuntu:~# make
make -C /lib/modules/3.2.0-23-generic/build M= modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-23-generic'
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CC [M] drivers/bluetooth/btusb.o
drivers/bluetooth/btusb.c:67:2: error: implicit declaration of function ‘USB_VENDOR_AND_INTERFACE_INFO’ [-Werror=implicit-function-declaration]
drivers/bluetooth/btusb.c:67:2: error: initializer element is not constant
drivers/bluetooth/btusb.c:67:2: error: (near initialization for ‘btusb_table[1].match_flags’)
drivers/bluetooth/btusb.c:116:2: error: initializer element is not constant
drivers/bluetooth/btusb.c:116:2: error: (near initialization for ‘btusb_table[20].match_flags’)
drivers/bluetooth/btusb.c:119:2: error: initializer element is not constant
drivers/bluetooth/btusb.c:119:2: error: (near initialization for ‘btusb_table[21].match_flags’)
drivers/bluetooth/btusb.c: In function ‘btusb_probe’:
drivers/bluetooth/btusb.c:1099:6: error: ‘struct hci_dev’ has no member named ‘load_firmware’
drivers/bluetooth/btusb.c:1099:2: warning: statement with no effect [-Wunused-value]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bluetooth/btusb.o] Error 1
make[2]: *** [drivers/bluetooth] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-23-generic'
make: *** [all] Error 2
i downloaded the copy of btusb.c from LXR but gives the same errors...
you mean i dont need to compile bluetooth drivers.
my helloworld program is the basic program which may be found out is first lesson of driver or module compilation....
obj-m += mymodule.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
actualy my problem was http://http://www.linuxquestions.org...em-4175439981/
as you said i copied bound.c,but then it showed that problem for other files too. so i copied these all which were needed...and above
problem came..so say me something atleast about where am i wrong.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 7 . The Debian / Ubuntu package names are : linux-image , linux-headers.
You already know the 'linux-headers' version : linux-headers-3.2.0-23-generic
The "kernel in use" : $ uname -r
'linux-image' and 'linux-headers' must be the same version, to make a module.
And the compiler gcc must be the same that was used to compile your working kernel.
That's most often the default gcc, but not always.
Ubuntu 12.04 : gcc-4.6.3 ?
root@ubuntu:~# dpkg --list | grep linux-image
ii linux-image-3.2.0-23-generic 3.2.0-23.36 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-generic 3.2.0.23.25 Generic Linux kernel image
root@ubuntu:~#
is this difference...
i think it was because recently i downloaded headers-3.2.0-23.36,if so where i would get headers-3.2.0.23.25
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 9 : sudo insmod hello.ko : OK here.
These are the installed packages :
Code:
$ dpkg --list | grep linux-image
ii linux-image-3.2.0-23-generic-pae 3.2.0-23.36
Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-generic-pae 3.2.0.23.25
Generic Linux kernel image
$ dpkg --list | grep linux-headers
ii linux-headers-3.2.0-23 3.2.0-23.36
Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-23-generic-pae 3.2.0-23.36
Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii linux-headers-generic-pae 3.2.0.23.25
Generic Linux kernel headers
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.