Make problem, says undnefined reference

Support and queries relating to all previous versions of ZoneMinder
Locked
rcswrc
Posts: 29
Joined: Thu Dec 29, 2005 10:19 pm
Location: Costa Rica

Make problem, says undnefined reference

Post by rcswrc »

i have followed every step but when i compile "type make" it give th following errors

make[2]: Entering directory `/home/rcs/Programas/zm-1.21.4/src'
g++ -g -O2 -L/usr -L/usr/lib -L/usr/lib/mysql -o zmc zmc.o zm.o zm_db.o zm_c
onfig.o zm_coord.o zm_box.o zm_image.o zm_event.o zm_zone.o zm_camera.o zm_local
_camera.o zm_remote_camera.o zm_file_camera.o zm_monitor.o zm_user.o zm_mpeg.o z
m_jpeg.o zm_regexp.o zm_buffer.o zm_debug.o -lavformat -lavcodec -lavutil -lpcr
e -lmysqlclient -ldl -lz -ljpeg
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_header': undefined re
ference to `dc1394_create_handle'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_header': undefined re
ference to `dc1394_get_camera_nodes'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_header': undefined re
ference to `dc1394_dma_setup_capture'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_header': undefined re
ference to `dc1394_destroy_handle'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_header': undefined re
ference to `dc1394_start_iso_transmission'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_header': undefined re
ference to `dc1394_dma_unlisten'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_header': undefined re
ference to `dc1394_dma_release_camera'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_packet': undefined re
ference to `dc1394_dma_done_with_buffer'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_read_packet': undefined re
ference to `dc1394_dma_single_capture'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_close': undefined referenc
e to `dc1394_stop_iso_transmission'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_close': undefined referenc
e to `dc1394_dma_unlisten'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_close': undefined referenc
e to `dc1394_dma_release_camera'
/usr/lib/libavformat.a(dc1394.o): In function `dc1394_close': undefined referenc
e to `dc1394_destroy_handle'
/usr/lib/libavformat.a(ogg.o): In function `ogg_write_header': undefined referen
ce to `ogg_stream_init'
/usr/lib/libavformat.a(ogg.o): In function `ogg_write_header': undefined referen
ce to `ogg_stream_packetin'
/usr/lib/libavformat.a(ogg.o): In function `ogg_write_packet': undefined referen
ce to `ogg_stream_flush'
/usr/lib/libavformat.a(ogg.o): In function `ogg_write_packet': undefined referen
ce to `ogg_stream_packetin'
/usr/lib/libavformat.a(ogg.o): In function `ogg_write_packet': undefined referen
ce to `ogg_stream_pageout'
/usr/lib/libavformat.a(ogg.o): In function `ogg_write_trailer': undefined refere
nce to `ogg_stream_flush'
/usr/lib/libavformat.a(ogg.o): In function `ogg_write_trailer': undefined refere

and others similar to these, i have reinstalled everything but it keeps giving me the same problems

any idea of what to do?
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

It looks like you have compiled in a bunch of extra options into ffmpeg and not everything is available. You need to make sure you have all the development packages installed and the libraries and progarms for them etc...

Vorbis
dc1394
oggTheora
etc...

Corey
brumster
Posts: 2
Joined: Sun Jan 01, 2006 10:25 am
Location: Birmigham, UK

Post by brumster »

Hi all,

I'm getting a similar problem :-

Code: Select all

g++  -g -O2  -L/usr -L/usr/lib -L/usr/lib/mysql  -o zmc  zmc.o zm.o zm_db.o zm_config.o zm_coord.o zm_box.o zm_image.o zm_event.o zm_zone.o zm_camera.o zm_local_camera.o zm_remote_camera.o zm_file_camera.o zm_monitor.o zm_user.o zm_mpeg.o zm_jpeg.o zm_regexp.o zm_buffer.o zm_debug.o  -lmp3lame -lavcodec -lavutil -lcrypto -lmysqlclient -ldl -lz -ljpeg
zm_mpeg.o(.text+0x7): In function `VideoStream::Initialise()':
/root/zm-1.21.4/src/zm_mpeg.cpp:32: undefined reference to `av_register_all'
zm_mpeg.o(.text+0x2f): In function `VideoStream::SetupFormat(char const*, char const*)':
/root/zm-1.21.4/src/zm_mpeg.cpp:42: undefined reference to `guess_format'
zm_mpeg.o(.text+0xe6):/root/zm-1.21.4/src/zm_mpeg.cpp:46: undefined reference to `guess_format'
zm_mpeg.o(.text+0x16d): In function `VideoStream::SetupCodec(int, int, int, int, int)':
/root/zm-1.21.4/src/zm_mpeg.cpp:72: undefined reference to `av_new_stream'
zm_mpeg.o(.text+0x267): In function `VideoStream::SetParameters()':
/root/zm-1.21.4/src/zm_mpeg.cpp:119: undefined reference to `av_set_parameters'
zm_mpeg.o(.text+0x479): In function `VideoStream::OpenStream()':
/root/zm-1.21.4/src/zm_mpeg.cpp:191: undefined reference to `url_fopen'
zm_mpeg.o(.text+0x77b): In function `VideoStream::~VideoStream()':
/root/zm-1.21.4/src/zm_mpeg.cpp:252: undefined reference to `av_write_trailer'
zm_mpeg.o(.text+0x7ac):/root/zm-1.21.4/src/zm_mpeg.cpp:263: undefined reference to `url_fclose'
zm_mpeg.o(.text+0x857): In function `VideoStream::~VideoStream()':
/root/zm-1.21.4/src/zm_mpeg.cpp:252: undefined reference to `av_write_trailer'
zm_mpeg.o(.text+0x888):/root/zm-1.21.4/src/zm_mpeg.cpp:263: undefined reference to `url_fclose'
zm_mpeg.o(.text+0x9c8): In function `VideoStream::EncodeFrame(unsigned char*, int, bool, unsigned int)':
/usr/local/include/ffmpeg/avformat.h:56: undefined reference to `av_destruct_packet_nofree'
zm_mpeg.o(.text+0xa39): In function `VideoStream::EncodeFrame(unsigned char*, int, bool, unsigned int)':
/root/zm-1.21.4/src/zm_mpeg.cpp:338: undefined reference to `av_write_frame'
zm_mpeg.o(.text+0xadf): In function `VideoStream::EncodeFrame(unsigned char*, int, bool, unsigned int)':
/usr/local/include/ffmpeg/avformat.h:56: undefined reference to `av_destruct_packet_nofree'
zm_mpeg.o(.text+0xb05): In function `VideoStream::EncodeFrame(unsigned char*, int, bool, unsigned int)':
/root/zm-1.21.4/src/zm_mpeg.cpp:315: undefined reference to `av_write_frame'
zm_mpeg.o(.text+0x3e1): In function `VideoStream::OpenStream()':
/root/zm-1.21.4/src/zm_mpeg.cpp:215: undefined reference to `av_write_header'
This is FC4, ZM 1.21. MySQL side is all hunky-dory. I tried it with ffmpeg via rpm (yum install ffmpeg ffmpeg-devel) but with no joy, so I downloaded the latest CVS of ffmpeg and built it myself, but that made no difference. ffmpeg was built with :-

Code: Select all

./configure --enable-gpl --enable-shared --enable-mp3lame --enable-xvid
The ZoneMinder configure is :-

Code: Select all

./configure --with-mysql=/usr --with-webdir=/var/www/html/zoneminder --with-cgidir=/var/www/cgi-bin
What's I'm curious about, and don't know whether it's related, is the following highlighted line from my configure :-

configure: WARNING: libavformat.a is required for MPEG streaming

Code: Select all

[root@server1 zm-1.21.4]# ./configure --with-mysql=/usr --with-ffmpeg --with-lame --with-webdir=/var/www/html/zoneminder --with-cgidir=/var/www/cgi-bin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: WARNING: You can call configure with the --with-webuser option.
    This tells configure what the user name of the web user is if it is not the default of 'apache'.
    e.g. --with-webuser=apache or --with-webuser=web
configure: WARNING: You can call configure with the --with-webgroup option.
    This tells configure what the group name of the web group is if it is not the default of 'apache'.
    e.g. --with-webgroup=apache or --with-webgroup=web
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking how to run the C++ preprocessor... g++ -E
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no
checking pcre.h usability... no
checking pcre.h presence... no
checking for pcre.h... no
checking whether round is declared... yes
checking whether strsignal is declared... yes
checking whether MD5 is declared... yes
checking for jpeg_start_compress in -ljpeg... yes
checking for compress in -lz... yes
checking for dlsym in -ldl... yes
checking for mysql_init in -lmysqlclient... yes
checking for MD5 in -lcrypto... yes
checking for pcre_compile in -lpcre... no
configure: WARNING: libpcre.a may be required for some remote/network camera support
checking for ff_gcd in -lavutil... yes
checking for avcodec_init in -lavcodec... yes
checking for av_new_stream in -lavformat... no
configure: WARNING: libavformat.a is required for MPEG streaming
checking for lame_init in -lmp3lame... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating web/Makefile
config.status: creating web/graphics/Makefile
config.status: creating scripts/Makefile
config.status: creating db/Makefile
config.status: creating zmconfig.pl
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
checking for zmconfig.txt... yes
...the reason being, it's present /usr/lib/libavcodec (and /usr/lib too, FWIW, as I put it there manually)

Any ideas?

Cheers,
Dan
brumster
Posts: 2
Joined: Sun Jan 01, 2006 10:25 am
Location: Birmigham, UK

Post by brumster »

Scratch that - fixed it; it was just my configure line wasn't it :)

Anyway, I'll leave it here for reference - sorry for the spammage

Code: Select all

./configure --with-mysql=/usr --with-ffmpeg=/usr/local --with-lame --with-webdir=/var/www/html/zoneminder --with-cgidir=/var/www/cgi-bin
make
Locked