我试着在linux内核源代码(2.6.18.8版本)中使用llvm- of (llvm 1.7版)编译一个驱动程序(linux/drivers/net/zorro8390.c)用于研究,但我从jiffies.h中得到了很多错误:
bash-3.2$ llvm-gcc -D__GNUCC -E -I../../include zorro8390.c -o test.o
In file included from ../../include/linux/lockdep.h:12,
from ../../include/linux/spinlock_types.h:
我正在学习通过v4l2 -v4l2配置视频设备的ctl。很久以前的代码样本真的已经过时了,一些定义不再起作用。有一种新方法可以从内核请求API的所有内容,如v4l2-utils所示。我正在尝试将v4l2-utils中的一些代码合并到我的代码中。但是,我从编译器得到一个错误:
camera.hpp:1038:8: error: 'struct v4l2_ext_controls' has no member named 'which'
ctrls.which = V4L2_CTRL_ID2WHICH(qctrl.id);
和:
camera.hpp:1038:43
我在读罗伯特·洛夫的"Linux内核开发“。我碰到一条我无法完全理解的界线:-
The kernel source is installed in /usr/src/linux. You should not use this source tree for development because the kernel version against which your C library is compiled is often linked to this tree.
看起来我无法把它和一些非常基本的概念联系起来。
我正在尝试编译一个库,其中包含来自kernel-devel包的一些头文件。我链接了适当的头文件,但现在在这些头文件中出现编译错误。
/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