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”指定一下都文件
离线
问题已经解决,冲内核头文件找到了相关定义,指定或者在代码中声明就可以编译通过了
离线