linuxコンパイルモジュールにconfigが欠けていることについてhエラーが発生した問題


質問元:Compiling for/home/dsr-uu-0.2 make-C/lib/modules/2.6.18-1.2798.fc6/build SUBDIRS=/home/dsr-uu-0.2 modules make[1]: Entering directory `/usr/src/kernels/2.6.18-1.2798.fc6-i686'   CC [M] /home/dsr-uu-0.2/dsr-module.o/home/dsr-uu-0.2/dsr-module.c:16:26:エラー:linux/config.h:そのファイルやディレクトリがないmake[2]:*********/dsr-uu-0.2/dsr-module.o]エラー1 make[1]:***[_module_/home/dsr-uu-0.2]エラー2 make[1]:Leaving directory`/usr/src/kernels/2.6.18-1.2798.fc 6-i 686'make:***[dsr.ko]エラー2解決方法;私が見る方法はネットで見たものです.ほほほ1)まず私の実験の正しい方法を貼り出します:The file include/linux/config.h has been removed from 2.6.18 kernel. So remember this if you build your favorite module against the new 2.6.19 kernel and you get an error. Thats because there is no more include/linux/config.h file in 2.6.19. This is from the Changelog:
Quote:
Author: Dave Jones Date: Mon Oct 9 19:13:51 2006 -0400 [HEADERS] Put linux/config.h out of its misery. Signed-off-by: Dave Jones Author: Paul Mundt Date: Tue Oct 3 13:19:02 2006 +0900 sh: Kill off remaining config.h references. A few of these managed to sneak back in, get rid of them once and for all. 解決方法:The reason I posted this for people who have the kernel sources installed and are trying to build a module against the sources and are getting the error I mentioned.You wouldn't be trying to build a module for the 2.6.19 kernel unless you had the sources installed. Actually there is not much to the file:
Code:
#ifndef _LINUX_CONFIG_H

#define _LINUX_CONFIG_H

/* This file is no longer in use and kept only for backward compatibility.

* autoconf.h is now included via -imacros on the commandline

*/

#include



#endif

So if you have problems you could probably just add to code here to your module.c file. 私は上と同じですが、プログラムは上のパッチを認識していません.だから、私は自分でconfigを含めてすべてを手動でhのソースファイルをautoconfに変更する.h.これで間違いはありません.しかし、2.6.23後にautoconfがなくなったという人もいます.h了.では、次の方法が役に立つかどうか見てみましょう.2)well the .h files are not from the main kernel package ,they are from the devel package(unless you built it yourself) if kernel-devel(or -source depending on distro) isn't installed there wouldn't be any useful includes.