您尚未登录。

楼主 # 2024-04-15 09:58:24

jkl
会员
注册时间: 2019-11-18
已发帖子: 265
积分: 148.5

100s,linux-3.10的内核,想要用内核自带的spidev_test.c来测试spidev,发现自带的编译不过?

jkangli@admin-PowerEdge-T630-212:~/test/f1c100s/spidev$ /home/jkangli/f1c100s/tina/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-arm9-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-gcc spidev_test.c
arm-openwrt-linux-muslgnueabi-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
In file included from /home/jkangli/f1c100s/tina/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-arm9-musl/toolchain/include/sys/ioctl.h:7:0,
                 from spidev_test.c:20:
spidev_test.c: In function 'transfer':
spidev_test.c:60:18: error: '_IOC_SIZEBITS' undeclared (first use in this function)
  ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
                  ^
spidev_test.c:60:18: note: each undeclared identifier is reported only once for each function it appears in
jkangli@admin-PowerEdge-T630-212:~/test/f1c100s/spidev$


大佬们,这是缺少了那个头文件,是不是需要“-I”指定一下都文件

离线

楼主 #1 2024-04-15 16:50:04

jkl
会员
注册时间: 2019-11-18
已发帖子: 265
积分: 148.5

Re: 100s,linux-3.10的内核,想要用内核自带的spidev_test.c来测试spidev,发现自带的编译不过?

问题已经解决,冲内核头文件找到了相关定义,指定或者在代码中声明就可以编译通过了

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn