Trouble compiling ZM 1.25.0 on Debian 6.0.4 x64 from source

Forum for questions and support relating to the 1.25.x releases only.
Locked
pdxkris
Posts: 2
Joined: Wed Jul 06, 2011 12:37 am

Trouble compiling ZM 1.25.0 on Debian 6.0.4 x64 from source

Post by pdxkris »

I have a fresh install of Debian 6.0.4 x64 that I plan on having as a dedicated ZM box. Following the wiki and a number of tutorials, I believe I have all of the pre-reqs installed, but am still having issues compiling ZM that I wasn't able to sort out by searching the forum.

Here's my ./configure settings:

Code: Select all

./configure --prefix=/opt/zm --with-webuser=www-data --with-webgroup=www-data --enable-mmap=yes --with-webdir=/var/www --with-cgidir=/usr/lib/cgi-bin ZM_SSL_LIB=openssl ZM_DB_PASS=**** --with-webhost=kZoneMinder
I export the following:

Code: Select all

export CFLAGS="-march=native -O2 -pipe" && \
export CXXFLAGS="${CFLAGS}" && \
export CPPFLAGS="${CFLAGS} -D__STDC_CONSTANT_MACROS"]
I'm able to fun ffmpeg successfully:

Code: Select all

ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  3 2012 15:05:55 with gcc 4.4.5
  configuration: --enable-gpl --enable-shared --enable-pthreads
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
Here are the "no" items from when I run configure:

Code: Select all

checking whether we are cross compiling... no
checking for gcc option to accept ISO C89... none needed
checking for _Bool... no
checking for struct sigcontext.eip... no
checking whether gcc needs -traditional... no
checking whether stat accepts an empty string... no
checking for _doprnt... no
checking for ioctlsocket... no
checking for pnmscale... no
checking for pnmscale... no
checking for x264_predict_16x16_init in -lx264... no
checking for av_image_copy in -lavcore... no
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no
And here's the fun part of the 'make' output (ran as root):

Code: Select all

lcrypto -ldl -lpthread -ljpeg -lmysqlclient 
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
zm_ffmpeg_camera.cpp:(.text+0x6d): undefined reference to `av_free_packet'
zm_ffmpeg_camera.cpp:(.text+0xf3): undefined reference to `avcodec_decode_video2'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x3c5): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x485): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::OpenStream()':
zm_mpeg.cpp:(.text+0x5e1): undefined reference to `avio_open'
zm_mpeg.o: In function `VideoStream::SetupFormat(char const*, char const*)':
zm_mpeg.cpp:(.text+0xaf3): undefined reference to `av_guess_format'
zm_mpeg.cpp:(.text+0xbd8): undefined reference to `av_guess_format'
zm_remote_camera_rtsp.o: In function `RemoteCameraRtsp::Capture(Image&)':
zm_remote_camera_rtsp.cpp:(.text+0x1c6): undefined reference to `avcodec_decode_video2'
collect2: ld returned 1 exit status
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
zm_ffmpeg_camera.cpp:(.text+0x6d): undefined referencemake[2]:  to *** [zmf] Error 1`
av_free_packet'
zm_ffmpeg_camera.cpp:(.text+0xf3): undefined make[2]: reference*** Waiting for unfinished jobs.... 
to `avcodec_decode_video2'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x3c5): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x485): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::OpenStream()':
zm_mpeg.cpp:(.text+0x5e1): undefined reference to `avio_open'
zm_mpeg.o: In function `VideoStream::SetupFormat(char const*, char const*)':
zm_mpeg.cpp:(.text+0xaf3): undefined reference to `av_guess_format'
zm_mpeg.cpp:(.text+0xbd8): undefined reference to `av_guess_format'
zm_remote_camera_rtsp.o: In function `RemoteCameraRtsp::Capture(Image&)':
zm_remote_camera_rtsp.cpp:(.text+0x1c6): undefined reference to `avcodec_decode_video2'
collect2: ld returned 1 exit status
make[2]: *** [zma] Error 1
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
zm_ffmpeg_camera.cpp:(.text+0x6d): undefined reference to `av_free_packet'
zm_ffmpeg_camera.cpp:(.text+0xf3): undefined reference to `avcodec_decode_video2'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x3c5): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x485): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::OpenStream()':
zm_mpeg.cpp:(.text+0x5e1): undefined reference to `avio_open'
zm_mpeg.o: In function `VideoStream::SetupFormat(char const*, char const*)':
zm_mpeg.cpp:(.text+0xaf3): undefined reference to `av_guess_format'
zm_mpeg.cpp:(.text+0xbd8): undefined reference to `av_guess_format'
zm_remote_camera_rtsp.o: In function `RemoteCameraRtsp::Capture(Image&)':
zm_remote_camera_rtsp.cpp:(.text+0x1c6): undefined reference to `avcodec_decode_video2'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
zm_ffmpeg_camera.cpp:(.text+0x6d): undefined reference to `av_free_packet'
zm_ffmpeg_camera.cpp:(.text+0xf3): undefined reference to `avcodec_decode_video2'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x3c5): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x485): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::OpenStream()':
zm_mpeg.cpp:(.text+0x5e1): undefined reference to `avio_open'
zm_mpeg.o: In function `VideoStream::SetupFormat(char const*, char const*)':
zm_mpeg.cpp:(.text+0xaf3): undefined reference to `av_guess_format'
zm_mpeg.cpp:(.text+0xbd8): undefined reference to `av_guess_format'
zm_remote_camera_rtsp.o: In function `RemoteCameraRtsp::Capture(Image&)':
zm_remote_camera_rtsp.cpp:(.text+0x1c6): undefined reference to `avcodec_decode_video2'
collect2: ld returned 1 exit status
make[2]: *** [zmu] Error 1
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
zm_ffmpeg_camera.cpp:(.text+0x6d): undefined reference to `av_free_packet'
zm_ffmpeg_camera.cpp:(.text+0xf3): undefined reference to `avcodec_decode_video2'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x3c5): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::~VideoStream()':
zm_mpeg.cpp:(.text+0x485): undefined reference to `avio_close'
zm_mpeg.o: In function `VideoStream::OpenStream()':
zm_mpeg.cpp:(.text+0x5e1): undefined reference to `avio_open'
zm_mpeg.o: In function `VideoStream::SetupFormat(char const*, char const*)':
zm_mpeg.cpp:(.text+0xaf3): undefined reference to `av_guess_format'
zm_mpeg.cpp:(.text+0xbd8): undefined reference to `av_guess_format'
zm_remote_camera_rtsp.o: In function `RemoteCameraRtsp::Capture(Image&)':
zm_remote_camera_rtsp.cpp:(.text+0x1c6): undefined reference to `avcodec_decode_video2'
collect2: ld returned 1 exit status
make[2]: *** [zms] Error 1
make[2]: Leaving directory `/home/zoneuser/Downloads/ZoneMinder-1.25.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zoneuser/Downloads/ZoneMinder-1.25.0'
make: *** [all] Error 2

I've tried a couple of different builds of ffmpeg (from source and apt), as well as ZM 1.25.0 and 1.24.4 but always get the same results. Can anybody suggest a direction to troubleshoot in? I'm technically savvy, but compiler issues aren't my strong point. Thanks!
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Trouble compiling ZM 1.25.0 on Debian 6.0.4 x64 from sou

Post by knight-of-ni »

I'm not running Debian. However, I thought I'd throw a couple of suggestions since no one else has stepped in:
  • When you built ffmpeg, did you run "make install-libs" in addition to the usual "make install"?
  • Try using ffmpeg 0.6.5 from git. The latest ffmpeg causes zoneminder 1.25 to not compile properly on CentOS so perhaps the same is true for Debian.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
pdxkris
Posts: 2
Joined: Wed Jul 06, 2011 12:37 am

Re: Trouble compiling ZM 1.25.0 on Debian 6.0.4 x64 from sou

Post by pdxkris »

Thanks for trying, but still no luck :(

I reverted to a snapshot I had taken before installing ffmpeg previously and pulled the 0.6.5 version from git, compiled it successfully (including make install-libs as I had done before). ffmpeg 0.6.5 itself seems to work, but I still get this when trying to compile ZM:

Code: Select all

...
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
zm_ffmpeg_camera.cpp:(.text+0x6d): undefined reference to `av_free_packet'
zm_ffmpeg_camera.cpp:(.text+0xf3): undefined reference to `avcodec_decode_video2'
zm_mpeg.o: In function `VideoStream::SetupFormat(char const*, char const*)':
zm_mpeg.cpp:(.text+0xaf3): undefined reference to `av_guess_format'
zm_mpeg.cpp:(.text+0xbd8): undefined reference to `av_guess_format'
zm_remote_camera_rtsp.o: In function `RemoteCameraRtsp::Capture(Image&)':
zm_remote_camera_rtsp.cpp:(.text+0x1c6): undefined reference to `avcodec_decode_video2'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/home/zoneuser/Downloads/ZoneMinder-1.25.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zoneuser/Downloads/ZoneMinder-1.25.0'
make: *** [all] Error 2

User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Trouble compiling ZM 1.25.0 on Debian 6.0.4 x64 from sou

Post by knight-of-ni »

Have you read these by chance?

http://www.zoneminder.com/wiki/index.php/Debian

http://www.zoneminder.com/wiki/index.ph ... re_2011%29

According to the first link, zoneminder is in the Debian unstable repository so you may be able to cheat and just do an "apt-get install zoneminder"

The second link is in Spanish, but looking through it, the author does the following immediately after compiling ffmpeg:

Code: Select all

cd /lib && ln -s /usr/local/lib/libswscale.so.0 && \
ln -s /usr/local/lib/libavformat.so.52 && \
ln -s /usr/local/lib/libavcodec.so.52 && \
ln -s /usr/local/lib/libavutil.so.50 && \
ln -s /usr/local/lib/libavdevice.so.52

ldconfig
hope that helps.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Locked