Posted by & filed under Linux, Web Server.

We recently attempting to compile ffmpeg 0.5 on a web server, and had the following errors:

In file included from libavdevice/v4l.c:32:
/usr/include/linux/videodev.h:56: error: syntax error before "ulong"
/usr/include/linux/videodev.h:72: error: syntax error before '}' token
libavdevice/v4l.c: In function `grab_read_header':
libavdevice/v4l.c:77: error: storage size of 'tuner' isn't known
libavdevice/v4l.c:141: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:148: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:77: warning: unused variable `tuner'
make: *** [libavdevice/v4l.o] Error 1

The error is a syntax error saying that the servers compiler doesn’t know what “ulong” is. This is a synonym for “unsigned long”, so to fix this make the following changes to /usr/include/linux/videodev.h line 56:

pico /usr/include/linux/videodev.h
ulong rangelow, rangehigh;      /* Tuner range */
unsigned long rangelow, rangehigh;      /* Tuner range */

Once you do that you should be able to compile the program just fine.

Thomas Hunter II

Support Thomas on Patreon. Thomas is the author of Advanced Microservices and a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.