Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionUbuntu 11.04 64-bit [Tried on SuSE 32-bit, and got same error], I have gcc, and can compile normal C programs.. and the linux headers in /usr/src/linux-headers-2.6*
I downlaoded this driver:
http://qce-ga.sourceforge.net/#download
downloaded, extracted, ran make all
and this is the output
matt: /d/dl/qc-usb-0.6.6 $ make all
make -C "/lib/modules/2.6.38-8-generic/build" SUBDIRS="/home/matt/Desktop/dl/qc-usb-0.6.6" modules V=1 USER_OPT="-DHAVE_UTSRELEASE_H="
make[1]: Entering directory `/usr/src/linux-headers-2.6.38-8-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /home/matt/Desktop/dl/qc-usb-0.6.6/.tmp_versions ; rm -f /home/matt/Desktop/dl/qc-usb-0.6.6/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/matt/Desktop/dl/qc-usb-0.6.6
gcc -Wp,-MD,/home/matt/Desktop/dl/qc-usb-0.6.6/.qc-driver.o.d -nostdinc -isystem /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/include -I/usr/src/linux-headers-2.6.38-8-generic/arch/x86/include -Iinclude -include include/generated/autoconf.h -Iubuntu/include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m开发者_JAVA百科64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=1024 -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -DNOKERNEL -DHAVE_UTSRELEASE_H= -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(qc_driver)" -D"KBUILD_MODNAME=KBUILD_STR(quickcam)" -c -o /home/matt/Desktop/dl/qc-usb-0.6.6/.tmp_qc-driver.o /home/matt/Desktop/dl/qc-usb-0.6.6/qc-driver.c
In file included from /home/matt/Desktop/dl/qc-usb-0.6.6/qc-driver.c:47:0:
/home/matt/Desktop/dl/qc-usb-0.6.6/quickcam.h:79:28: fatal error: linux/autoconf.h: No such file or directory
compilation terminated.
make[2]: *** [/home/matt/Desktop/dl/qc-usb-0.6.6/qc-driver.o] Error 1
make[1]: *** [_module_/home/matt/Desktop/dl/qc-usb-0.6.6] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.38-8-generic'
make: *** [quickcam.ko] Error 2
Note: I tried what this is suggesting I run [make oldconfig &&]. Here is a URL of the output: http://pastebin.com/ccnYn9uc
I googled a bit, and someone said to, in the kernel source, run make menuconfig
and so I ran it but I have no clue what to change.. can you help me? thanks
You are trying to compile on 2.6.38, but include/linux/autoconf.h
does not exist anymore since 2.6.33 (it was moved somewhere else in commit 264a26838056fc2d759f58bec2e720e01fcb1bdb
). Besides, it should not need to be included by hand - the kernel build system does it automatically for you (see the -include
in the gcc
command line).
You do not need to run make menuconfig
, and probably should not change anything using it - the kernel is already configured for your distribution, and changing it to something which does not match the running kernel can make the module not work correctly. Even make oldconfig
should not be needed; what looks like a message saying to run make oldconfig
is in fact code to detect if it is needed and print that message in that case (for some reason the driver you are trying to compile enabled some verbose mode which prints all commands before running them).
The problem you have is that the driver you are trying to compile is too old - the sourceforge release page shows it is from 2006, back when the latest kernel was still 2.6.18. The kernel internal API is not stable and changes frequently, so even if you fixed that error (probably simply removing the incorrect #include
), it will probably still fail to compile due to several other changes. The drivers which come with the Linux kernel do not have that problem because it is the responsibility of the one who made the API change to fix all the drivers, but for drivers which are outside the Linux kernel tree, it is the driver author's responsibility to closely follow the kernel development and fix his driver whenever the API changed.
Your options are to find a newer driver (one which works in 2.6.38), or get someone who understands the Linux kernel to update your driver to 2.6.38. And to prevent it breaking in the future, it should be submitted to the Linux kernel.
And in fact, the kernel does seem to already have a driver for these devices. It is called gspca_stv06xx
, and claims the three USB IDs the driver you were trying to compile claims - and many more.
One must wonder what did you Google. http://www.google.ca/search?sourceid=chrome&ie=UTF-8&q=%22fatal+error%3A+linux%2Fautoconf.h%3A+No+such+file+or+directory%22 very first result is a https://bbs.archlinux.org/viewtopic.php?id=103348 topic about a webcam(!) albeit on Arch it must be relevant. It's leading to http://aur.archlinux.org/packages.php?ID=9861 where you can find a tarball containing autoconf.patch
. Read the topic and the linked Ubuntu topic it seems helpful.
精彩评论