簡體   English   中英

V4L2 - 標題不完整

[英]V4L2 - Header incomplete

我想在 C 中使用 V4L。

如果我按照https://lwn.net/Articles/204545/上的教程操作並創建一個包含內容的文件 main.c

#include <linux/videodev2.h>

這不能用gcc -std=c17編譯。 它給出了錯誤/usr/include/linux/videodev2.h:2320:20: error: field 'timestamp' has incomplete type

它確實適用於gcc -std=gnu11但我寧願使用gcc -std=gnu11而不是 gnu 方言。 這是我可以期待的工作嗎? 我應該報告錯誤嗎? 我會在哪里報告錯誤。

我知道我可以在<linux/videodev2.h>之前包含<time.h> <linux/videodev2.h>但它似乎仍然有問題。

編輯:該問題可以減少與 v4l 無關,但與 linux 頭文件 (?) 無關。

#include <sys/time.h>
struct timespec x;

我不清楚<sys/time.h>是否應該包含struct timespec

根據linux/videodev2.htimestamp是一個struct timeval 這又是一個 GNU C 庫擴展。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM