[Solved - clean install] Compiling fails on Ubuntu 11.10 x64

Forum for questions and support relating to the 1.25.x releases only.
Locked
sabaka33
Posts: 8
Joined: Wed Sep 02, 2009 7:13 am

[Solved - clean install] Compiling fails on Ubuntu 11.10 x64

Post by sabaka33 »

Having trouble compiling Zoneminder. Started on 10.04LTS and couldn't figure out how to get past "Undefined reference to av_free_packet" error. Upgraded to 11.10 and now getting a slightly different error. Could someone please point me in the right direction?

make error (replaced the g++ line with "..." spam filters didn't like it)

Code: Select all

# make
make  all-recursive
make[1]: Entering directory `/usr/src/ZoneMinder-1.25.0'
Making all in src
make[2]: Entering directory `/usr/src/ZoneMinder-1.25.0/src'
...
zm_mpeg.o: In function `VideoStream::OpenStream()':
/usr/src/ZoneMinder-1.25.0/src/zm_mpeg.cpp:225: undefined reference to `avio_open'
zm_mpeg.o: In function `~VideoStream':
/usr/src/ZoneMinder-1.25.0/src/zm_mpeg.cpp:293: undefined reference to `avio_close'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/usr/src/ZoneMinder-1.25.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/ZoneMinder-1.25.0'
make: *** [all] Error 2
configured with:

Code: Select all

./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin \
ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser \
ZM_DB_PASS=zmpass ZM_SSL_LIB=openssl --enable-debug=no \
ZM_SSL_LIB=gnutls --with-webgroup=wwwdata --with-webuser=wwwdata --enable-mmap CPPFLAGS="-D__STDC_CONSTANT_MACROS ${CPPFLAGS}"
ffmpeg version

Code: Select all

ffmpeg version N-37057-gb9db728
built on Jan 23 2012 01:56:59 with gcc 4.4.3
configuration: --enable-gpl --enable-shared --enable-pthreads
libavutil      51. 34.101 / 51. 34.101
libavcodec     53. 57.105 / 53. 57.105
libavformat    53. 30.100 / 53. 30.100
libavdevice    53.  4.100 / 53.  4.100
libavfilter     2. 59.101 /  2. 59.101
libswscale      2.  1.100 /  2.  1.100
libswresample   0.  6.100 /  0.  6.100
libpostproc    52.  0.100 / 52.  0.100
system info

Code: Select all

Linux zm 2.6.38-13-server #53-Ubuntu SMP Mon Nov 28 19:52:56 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Last edited by sabaka33 on Tue Feb 07, 2012 7:29 pm, edited 1 time in total.
User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by eracc »

<--- Not a *buntu user so I do not know how you would determine this. But, do you know for certain you have all the development versions of the libraries needed?
sabaka33
Posts: 8
Joined: Wed Sep 02, 2009 7:13 am

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by sabaka33 »

libavformat-dev, libavcodec-dev, libavutil-dev & libswscale-dev are all installed and up to date. These are all the libraries included in zm_ffmpeg.h, are there any I'm missing? I'm completely out of ideas, googled anything I could possibly think of :(
User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by eracc »

You see no errors or warnings during ./configure?
User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by eracc »

Here is the myconfig script I use to build ZM on the Mageia 64-bit RPM based systems I build here:

Code: Select all

#!/bin/bash
echo "Cleaning ..."
make distclean > distclean_result.txt 2>&1
echo "Running configure ..."
./configure CPPFLAGS=-D__STDC_CONSTANT_MACROS\
 --with-libarch=/lib64\
 --with-mysql=/usr/include\
 --with-ffmpeg=/usr/share\
 --with-extralibs="-lmp3lame"\
 --with-extralibs="-ltheora"\
 --with-extralibs="-lfaad"\
 --with-webdir=/var/www/html\
 --with-cgidir=/var/www/cgi-bin\
 --with-webuser=apache\
 --with-webgroup=apache\
 --disable-debug\
 --disable-crashtrace\
 --disable-mmap\
 > config_result.txt 2>&1
echo "Done. Check distclean_result.txt and config_result.txt for output."
Since I build for other people I do not use the default db user/pass. I set the DB user and password for each build by hand in the zm.conf file in the Build directory prior to running 'make install'. Feel free to modify this simple script for your use.
sabaka33
Posts: 8
Joined: Wed Sep 02, 2009 7:13 am

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by sabaka33 »

Thanks for that config script.

No errors during ./configure. Here are all the warnings I get & all "no" lines:

Code: Select all

checking for gawk... no
configure: WARNING: You can call configure with the --with-extralibs option.
    Ordinarily you will need to use this option only when your copy of ffmpeg has been built
    with support for additional formats and you would use this option to detail which additional
    libraries ffmpeg was built with so that it is able to link successfully with ZoneMinder.
    You will need to wrap this option in quotes if it contains any spaces.
    e.g. --with-extralibs="-lmp3lame"
configure: WARNING: You can call configure with the --with-webhost option.
    This tells configure what the host name is for name based virtual hosting. This is only used to populate the sample web/zmHttpd.conf file.
    e.g. --with-webhost=zm.localdomain
checking whether we are cross compiling... no
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 ffmpeg... /usr/local/bin/ffmpeg
checking for pnmscale... no
checking for pnmscale... no
checking for av_image_copy in -lavcore... no
checking linux/videodev.h usability... no
checking linux/videodev.h presence... no
checking for linux/videodev.h... no
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no
checking for perl module Device::SerialPort... no
configure: WARNING: Device::SerialPort is required for RS232/RS485 PTZ camera control
checking for perl module Expect... no
configure: WARNING: Expect is required for automatic event uploading using sftp
checking for perl module Archive::Zip... no
configure: WARNING: Archive::Zip may be required for automatic event uploading
checking for perl module X10::ActiveHome... no
configure: WARNING: X10::ActiveHome is required for X.10 support
Is there a way to trace down that undefined reference to 'avio_open' error? I just don't know where to even begin.
User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by eracc »

Well, as far as I know, and I am no programmer, undefined reference usually means missing libraries or missing functionality in libraries due to some "--include-foo" missing at the time the library was built. Your undefined reference message is for ffmpeg stuff, which can always give one headaches if not built properly. If you know you have installed the development libraries and are getting this error, then you may need to file a bug report with your distribution.

The other option is to try to build ffmpeg yourself. But man, I would hate to do that myself on a system that is supposed to be up to date and includes package management.
attilahooper
Posts: 20
Joined: Mon Feb 15, 2010 6:38 pm

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by attilahooper »

I just finished building 1.25.0 on a 32bit Debian Squeeze box using this guy's install guide
http://www.zoneminder.com/wiki/index.ph ... re_2011%29

Went without a hitch. Including building ffmpeg 0.9.1 from source. I used the libjpeg turbo i386, of course. He was missing the CPAN ftp packages I think, for the upload feature. I neglected cambozola and webmin, but that shouldn't matter, for it was a test build. First time I got Zm built from source.

A couple of lame nags; /etc/init.d/networking restart is deprecated. I used ifdown/up to set static ip. Needed to reboot after all was said and done, zm admin was coming up with a blank page.
sabaka33
Posts: 8
Joined: Wed Sep 02, 2009 7:13 am

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by sabaka33 »

Built x264 & ffmpeg from source using the following guide: http://ubuntuforums.org/showthread.php?t=786095. ZoneMinder make error remains src/zm_mpeg.cpp:225: undefined reference to `avio_open'. Will try guide suggested by attilahooper when I get home today.

Code: Select all

ffmpeg version git-2012-01-24-f1721fb
built on Jan 24 2012 12:06:40 with gcc 4.5.2
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
libavutil      51. 34.101 / 51. 34.101
libavcodec     53. 58.100 / 53. 58.100
libavformat    53. 30.100 / 53. 30.100
libavdevice    53.  4.100 / 53.  4.100
libavfilter     2. 60.100 /  2. 60.100
libswscale      2.  1.100 /  2.  1.100
libswresample   0.  6.100 /  0.  6.100
libpostproc    52.  0.100 / 52.  0.100
forgot to mention that I get stuck on the exact same error with 1.24.4 & 1.24.3 (after installing PHP::Serialization module that 1.24.3 ./configure complained about)
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by bb99 »

I notice the pcre complaint; check for pcre-devel package installed (PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5). Make sure you have the ffmpeg-devel installed also.
sabaka33
Posts: 8
Joined: Wed Sep 02, 2009 7:13 am

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by sabaka33 »

Tried that tutorial. Did not resolve error. Also tried same tutorial on a different machine running same OS, compiles just fine. Will probably just start from scratch and reinstall ubuntu when I get some free time.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by mastertheknife »

Here is a great guide on installing ZM from source on ubuntu:
http://www.zoneminder.com/wiki/index.ph ... rom_source

mastertheknife
Kfir Itzhak.
sabaka33
Posts: 8
Joined: Wed Sep 02, 2009 7:13 am

Re: Compiling fails on Ubuntu 11.10 Server x64

Post by sabaka33 »

Finally got time to do clean install of Ubuntu 2011.10 server. Followed guide posted by mastertheknife, zoneminder compiled and installed with no problems. Just had to change
--with-webdir=/var/www
to
--with-webdir=/var/www/zm
Thanks everyone for help.

Time to start troubleshooting the PV-183 - 16 port card. :x
Locked