BUG: vloopback_motion.c compile fails
Compilation fails at the make stage, complaining that the storage sizes of vid_pic and vid_win are not known. This happens even following a clean download of the most recent trunk build.
make
Welcome to the setup procedure for Motion, the motion detection daemon! If you get
error messages during this procedure, please report them to the mailing list. The
Motion Guide contains all information you should need to get Motion up and running.
Run "make updateguide" to download the latest version of the Motion Guide.
Version: trunkREV557
Platform: Linux (if this is incorrect, please read README.FreeBSD)
Generating dependencies, please wait...
Compiling Motion object files...
--------------------------------------------------------------------------------
gcc -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_FFMPEG -I/usr/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=native -mtune=native -Wall -DVERSION=\"trunkREV557\" -Dsysconfdir=\"/usr/local/etc\" -c -o motion.o motion.c
gcc -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_FFMPEG -I/usr/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=native -mtune=native -Wall -DVERSION=\"trunkREV557\" -Dsysconfdir=\"/usr/local/etc\" -c -o logger.o logger.c
logger.c: In function ‘motion_log’:
logger.c:232:2: warning: #warning "************************************" [-Wcpp]
logger.c:233:2: warning: #warning "* Using GNU-COMPLIANT strerror_r() *" [-Wcpp]
logger.c:234:2: warning: #warning "************************************" [-Wcpp]
gcc -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_FFMPEG -I/usr/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=native -mtune=native -Wall -DVERSION=\"trunkREV557\" -Dsysconfdir=\"/usr/local/etc\" -c -o conf.o conf.c
gcc -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_FFMPEG -I/usr/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=native -mtune=native -Wall -DVERSION=\"trunkREV557\" -Dsysconfdir=\"/usr/local/etc\" -c -o draw.o draw.c
gcc -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_FFMPEG -I/usr/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=native -mtune=native -Wall -DVERSION=\"trunkREV557\" -Dsysconfdir=\"/usr/local/etc\" -c -o jpegutils.o jpegutils.c
jpegutils.c: In function ‘decode_jpeg_gray_raw’:
jpegutils.c:773:20: warning: variable ‘hsf’ set but not used [-Wunused-but-set-variable]
gcc -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_FFMPEG -I/usr/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=native -mtune=native -Wall -DVERSION=\"trunkREV557\" -Dsysconfdir=\"/usr/local/etc\" -c -o vloopback_motion.o vloopback_motion.c
vloopback_motion.c: In function ‘v4l_open_vidpipe’:
vloopback_motion.c:48:15: warning: variable ‘ostatus’ set but not used [-Wunused-but-set-variable]
vloopback_motion.c:44:15: warning: variable ‘loop’ set but not used [-Wunused-but-set-variable]
vloopback_motion.c: In function ‘v4l_startpipe’:
vloopback_motion.c:185:26: error: storage size of ‘vid_pic’ isn’t known
vloopback_motion.c:186:25: error: storage size of ‘vid_win’ isn’t known
vloopback_motion.c:202:20: error: ‘VIDIOCGPICT’ undeclared (first use in this function)
vloopback_motion.c:202:20: note: each undeclared identifier is reported only once for each function it appears in
vloopback_motion.c:209:20: error: ‘VIDIOCSPICT’ undeclared (first use in this function)
vloopback_motion.c:214:20: error: ‘VIDIOCGWIN’ undeclared (first use in this function)
vloopback_motion.c:222:20: error: ‘VIDIOCSWIN’ undeclared (first use in this function)
vloopback_motion.c:186:25: warning: unused variable ‘vid_win’ [-Wunused-variable]
vloopback_motion.c:185:26: warning: unused variable ‘vid_pic’ [-Wunused-variable]
make: *** [vloopback_motion.o] Error 1
[Output from configure]
**************************
Configure status
motion trunkREV557
**************************
OS : Linux
pthread support: Yes
jpeg support: Yes
V4L support: Yes
V4L2 support: Yes
SDL support: Yes
FFmpeg support: Yes
SQLite3 support: Yes
MYSQL support: No
PostgreSQL support: No
CFLAGS: -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_FFMPEG -I/usr/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=native -mtune=native
LIBS: -lm -lpthread -L/usr/lib64 -lSDL -lpthread -ljpeg -L/usr/lib64 -lavformat -lavcodec -lavutil -lm -lz -lsqlite3
LDFLAGS: -L/usr/lib64
Install prefix: /usr/local
[The v4l libraries installed]
rpm -qa | grep v4l
libv4l1-0-0.8.5-2.1.2.x86_64
libv4l-devel-0.8.5-2.1.2.x86_64
libv4lconvert0-0.8.5-2.1.2.x86_64
libv4l-0.8.5-2.1.2.x86_64
libv4l2-0-0.8.5-2.1.2.x86_64
[To get this far, links were installed for libavcodec.so and libavformat.so]
/usr/lib64> ls -al libavcodec.*
lrwxrwxrwx 1 root root 22 Jul 15 09:12 libavcodec.so -> libavcodec.so.52.123.0
lrwxrwxrwx 1 root root 22 Jul 3 22:09 libavcodec.so.52 -> libavcodec.so.52.123.0
-rwxr-xr-x 1 root root 6340896 Jul 1 22:09 libavcodec.so.52.123.0
lrwxrwxrwx 1 root root 23 Jul 1 21:56 libavcodec.so.54 -> libavcodec.so.54.23.100
-rwxr-xr-x 1 root root 7571192 Jun 19 05:38 libavcodec.so.54.23.100
/usr/lib64> ls -al libavformat.*
lrwxrwxrwx 1 root root 23 Jul 15 09:12 libavformat.so -> libavformat.so.52.111.0
lrwxrwxrwx 1 root root 23 Jul 3 22:09 libavformat.so.52 -> libavformat.so.52.111.0
-rwxr-xr-x 1 root root 1005728 Jul 1 22:09 libavformat.so.52.111.0
lrwxrwxrwx 1 root root 23 Jul 1 21:56 libavformat.so.54 -> libavformat.so.54.6.100
-rwxr-xr-x 1 root root 1180696 Jun 19 05:38 libavformat.so.54.6.100
[libv4l-devel includes a replacement videodev.h file]
/usr/include/libv4l1-videodev.h
Environment
Motion version: |
trunkREV557 |
ffmpeg version: |
0.11.1-1.1.x86_64 |
Shared libraries: |
ffmpeg |
Server OS: |
OpenSuSE 12.1, 3.1.10-1.16-desktop, 64 bit. |
--
NormDePlume - 20 Jul 2012
Follow up
Fix record
Modifying the config.h file replacing the code:
/* Define to 1 if you have the <linux/videodev.h> header file. */
#define HAVE_LINUX_VIDEODEV_H 1
with this:
/* Define to 1 if you have the <linux/videodev.h> header file. *
/
/* #undef HAVE_LINUX_VIDEODEV_H */
Allowed me to compile properly. I am using trunk 557.
If you do not have videodev2.h on your machine I don't know if this will work properly for you.
--
RkaneKnight - 12 Mar 2013