Problems Compiling Zoneminder 1.28.1 on Ubuntu 14.10

Forum for questions and support relating to the 1.28.x releases only.
Locked
paulbuk
Posts: 6
Joined: Sat Mar 30, 2013 9:12 pm

Problems Compiling Zoneminder 1.28.1 on Ubuntu 14.10

Post by paulbuk »

Instead of using a package install (the easy way), I am attempting to compile 1.28.1 on Ubuntu 14.10 64 bit but am getting link errors that start with:

g++ -D__STDC_CONSTANT_MACROS -g -O2 -Lno/lib -L/usr/lib/ -L/usr/local/lib/mysql -L/usr/lib/mariadb -o zmc ...... -lz -lbz2 -lswscale -lavformat -lavcodec -lavutil -lx264 -lz -lpcre -lcrypto -ldl -lpthread -ljpeg -lmysqlclient

/usr/local/lib/libavformat.a(matroskadec.o): In function `matroska_decode_buffer':
/var/source/ffmpeg-2.6.1/libavformat/matroskadec.c:1303: undefined reference to `BZ2_bzDecompressInit'

/usr/local/lib/libavcodec.a(libfdk-aacdec.o): In function `fdk_aac_decode_frame':
/var/source/ffmpeg-2.6.1/libavcodec/libfdk-aacdec.c:325: undefined reference to `aacDecoder_Fill'

/usr/local/lib/libavcodec.a(libmp3lame.o): In function `mp3lame_encode_init':
/var/source/ffmpeg-2.6.1/libavcodec/libmp3lame.c:98: undefined reference to `lame_init'

ffmpeg seems to compile without error with:
./configure --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree

I have also tried with '--disable-bzlib --disable-zlib' and other combinations. I have compiled bzip2 and tried all sorts of options in the zoneminder .configure to remove the errors but I cannot work this out. The last .configure was:

./configure --with-webdir=/usr/share/ --with-cgidir=/usr/local/lib/cgi-bin --with-webgroup=lighttpd --with-webuser=lighttpd ZM_DB_HOST=192.168.0.9 ZM_DB_NAME=zm_new ZM_DB_USER=zmuser ZM_DB_PASS=zmpass --enable-debug=no --enable-mmap=yes --with-mysql=/usr/local --disable-debug --disable-crashtrace ZM_SSL_LIB=openssl --without-ffmpeg --without-mariadb

but even with '--without-ffmpeg' it is still generating errors that relate to ffmpeg.

From searching the web I can find suggestions of problems with the latest ffmpeg package that should have resolved with including '--disable-bzlib --disable-zlib' when compiling ffmpeg but no luck there. Any suggestions would be welcome. If I can get this to work I will add it to the wiki.

Thanks
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Problems Compiling Zoneminder 1.28.1 on Ubuntu 14.10

Post by asker »

I recently decided to torture myself and did the same thing. I also went ahead and decided I wanted to install ZM in a completely different directory, including its temporary files, run files, lock files, sock files etc.

Here is my history - some of it may or may not be applicable for you. Hope this helps (the ./configure has many flags, but that's because I wanted to change everything)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
paulbuk
Posts: 6
Joined: Sat Mar 30, 2013 9:12 pm

Re: Problems Compiling Zoneminder 1.28.1 on Ubuntu 14.10

Post by paulbuk »

Thanks for your build steps. After installing the extra packages and adding in 'make install-libs' the build gets past the errors I was getting and on to some different ones:

/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_subpacket':
/var/source/ffmpeg-2.6.1/libavcodec/opusdec.c:374: undefined reference to `swr_is_initialized'

At this point I think I have created a bit of a mess with mismatching packages and dependencies that I do not know how to sort out so will start afresh in a vm and just follow the steps from your post.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Problems Compiling Zoneminder 1.28.1 on Ubuntu 14.10

Post by asker »

The `swr_is_initialized' is because that function is in swresample and it is not included. After doing ./configure, I had to manually add it in src/Makefile (see my notes above).

adding it to extralibs did not work as the linker did not find it - it needs to be added at the end, not at the front
paulbuk wrote:Thanks for your build steps. After installing the extra packages and adding in 'make install-libs' the build gets past the errors I was getting and on to some different ones:

/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_subpacket':
/var/source/ffmpeg-2.6.1/libavcodec/opusdec.c:374: undefined reference to `swr_is_initialized'

At this point I think I have created a bit of a mess with mismatching packages and dependencies that I do not know how to sort out so will start afresh in a vm and just follow the steps from your post.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
paulbuk
Posts: 6
Joined: Sat Mar 30, 2013 9:12 pm

Re: Problems Compiling Zoneminder 1.28.1 on Ubuntu 14.10

Post by paulbuk »

That was the problem. It gave one more error after that which needed -lva at the end of that LIB line and then it compiled. Thanks for you help.
Locked