Re: time.h, included from videodev2.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hello Michael,

I created a local copy of <linux/videodev2.h>, "videodev2.h", made the conditional include and changed the include directive in my code, but now a zillion parse errors and warnings show up instead, like this first one:

In file included from videograb.c:4:
videodev2.h:118: parse error before `__s32'

To compile, I use

gcc -H -o videograb videograb.c

Any other gcc flags or additional includes I should be aware of? I tried -D__KERNEL__, resulting in the original 2 errors and a few more warnings.

Thomas

Michael Hunold wrote:
Hello Thomas,

In file included from /usr/include/linux/videodev2.h:17,
                 from videograb.c:6:
/usr/include/linux/time.h:9: redefinition of `struct timespec'
/usr/include/linux/time.h:17: redefinition of `struct timeval'
make: *** [videograb] Error 1


Can anyone hint towards a solution? The time.h definitions apart from timespec and timeval seem important, so time.h is needed for other reasons than those.


If you want to use the kernel header file "videodev2.h" for user-space applications you have to change

 > #include <linux/time.h> /* need struct timeval */

to

 > #ifdef __KERNEL__
 > #include <linux/time.h> /* need struct timeval */
 > #endif

right at the top of "videodev2.h".

Thanks in advance
Thomas


CU
Michael.



--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/video4linux-list






[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux