我想编译一个包含kernel-devel软件包头文件的库。我链接了合适的头文件,但现在我在这些头文件中出现编译错误。Linux内核头文件错误
/usr/include/asm-generic/bitops/fls64.h: In function ‘int fls64(__u64)’:
/usr/include/asm-generic/bitops/fls64.h:10: error: ‘fls’ was not declared in this scope
/usr/include/asm-generic/bitops/fls64.h:11: error: ‘fls’ was not declared in this scope
而且,这里有从ASM-通用/ bitops/fls64.h
#ifndef _ASM_GENERIC_BITOPS_FLS64_H_
#define _ASM_GENERIC_BITOPS_FLS64_H_
#include
static inline int fls64(__u64 x)
{
__u32 h = x >> 32;
if (h)
return fls(h) + 32;
return fls(x);
}
#endif /* _ASM_GENERIC_BITOPS_FLS64_H_ */
正如你所看到的代码 “返回FLS(H)”,有没有FLS的定义()。我可以通过包含“fls.h”来解决这个问题,但是我想在标准内核头文件中解决这些错误?
任何指针,可以解释为什么这样,我能做些什么来解决这些问题?顺便说一句,我在这里提到的错误只是冰山一角。在多个这样的头文件中有很多这样的(缺失解码)错误。
帮助将不胜感激。谢谢!
rgds/R。
PS:有些系统的详细信息:
Linux发行版:CentOS的(5.5)
[[email protected] common]$ uname -a
Linux localhost.localdomain 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:56 EDT 2011 i686 i686 i386 GNU/Linux
[[email protected] common]$ cat /proc/version
Linux version 2.6.18-238.9.1.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Tue Apr 12 18:10:56 EDT 2011
2011-05-20
Raj
+0
请发布更多来自编译器的输出。真正的错误可能在您引用的摘录之上。 –
2011-05-20 08:46:38
+0
罗宾,我没有发布更多,因为我认为这是无关紧要的。我担心的是我认为一个标准的Linux头文件fls64.h正在使用一个没有定义的函数。这是正常的吗? –
2011-05-20 12:13:37
+0
我认为这也取决于如何配置内核。代码是标准的,但配置可能有1000或更多的可能性。 –
2011-05-20 21:35:35