warning: ‘struct timespec‘ declared inside parameter list

交叉编译程序时,编译报错,错误如下:

./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 <time.h>了,但是仍然报错,不知道什么原因。后面网上查找原因,有人建议修改编译选项,我修改后编译通过。修改内容如下:

错误选项:
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

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-26 01:42:12       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-26 01:42:12       106 阅读
  3. 在Django里面运行非项目文件

    2024-05-26 01:42:12       87 阅读
  4. Python语言-面向对象

    2024-05-26 01:42:12       96 阅读

热门阅读

  1. 5、设计模式之适配器模式/原型模式

    2024-05-26 01:42:12       33 阅读
  2. 001 mongodb

    2024-05-26 01:42:12       33 阅读
  3. QT--splitter的使用

    2024-05-26 01:42:12       37 阅读
  4. 39. 组合总和 - 力扣(LeetCode)

    2024-05-26 01:42:12       31 阅读
  5. 169. 多数元素

    2024-05-26 01:42:12       37 阅读
  6. 15、Go Gin常见响应返回详解

    2024-05-26 01:42:12       37 阅读
  7. 掌握C++回调:按值捕获、按引用捕获与弱引用

    2024-05-26 01:42:12       35 阅读