交叉编译程序时,编译报错,错误如下:
./lib/libgpiod/gpiod.h:204:24: warning: 'struct timespec' declared inside parameter list
const struct timespec *, void *);
./lib/libgpiod/gpiod.h:367:4: warning: 'struct timespec' declared inside parameter list
void *data) GPIOD_API;
./lib/libgpiod/gpiod.h:1143:18: error: field 'ts' has incomplete type
struct timespec ts;
经排查“struct timespec”在time.h中定义,而gpiod.h中已经include
错误选项:
CFLAGS := -Wall -Wextra -pedantic -std=c99 -I. -I./driver -I./lib/libgpiod
编译通过选项:
CFLAGS := -Wall -Wextra -pedantic -std=gnu99 -I. -I./driver -I./lib/libgpiod
即将-std=c99 改为-std=gnu99
还没有评论,来说两句吧...