Link problem on CentOS4, compiles OK
Question
Hi I have a link problem on
CentOS4.
Motion object files compiled.
Linking Motion...
--------------------------------------------------------------------------------
gcc -L/usr/local/lib -o motion motion.o conf.o draw.o video.o netcam.o netcam_ftp.o netcam_jpeg.o netcam_wget.o track.o alg.o event.o picture.o rotate.o webhttpd.o webcam.o ffmpeg.o -lm -lpthread -ljpeg -L/usr/local/lib -lavformat -lavcodec -lm -lz -L/usr/lib/mysql -lmysqlclient -lz
/usr/local/lib/libavformat.a(utils.o)(.text+0xaa5): In function `compute_pkt_fields':
/root/ffmpeg/libavformat/utils.c:774: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x1d6a): In function `av_seek_frame_binary':
/root/ffmpeg/libavformat/utils.c:1371: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x1eca):/root/ffmpeg/libavformat/utils.c:1122: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x2649): In function `av_seek_frame':
/root/ffmpeg/libavformat/utils.c:1508: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x2747):/root/ffmpeg/libavformat/utils.c:1122: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x2dec): In function `av_find_stream_info':
/root/ffmpeg/libavformat/utils.c:2011: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x314b):/root/ffmpeg/libavformat/utils.c:2041: undefined reference to `av_reduce'
/usr/local/lib/libavformat.a(utils.o)(.text+0x32dd):/root/ffmpeg/libavformat/utils.c:1972: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x3564):/root/ffmpeg/libavformat/utils.c:1630: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x362d):/root/ffmpeg/libavformat/utils.c:1564: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x36f3):/root/ffmpeg/libavformat/utils.c:1564: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x38c2):/root/ffmpeg/libavformat/utils.c:2048: undefined reference to `av_reduce'
/usr/local/lib/libavformat.a(utils.o)(.text+0x3ab0):/root/ffmpeg/libavformat/utils.c:1569: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x3e70):/root/ffmpeg/libavformat/utils.c:1599: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x3eb3):/root/ffmpeg/libavformat/utils.c:1601: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x42dc):/root/ffmpeg/libavformat/utils.c:1564: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x4354):/root/ffmpeg/libavformat/utils.c:1601: undefined reference to `av_rescale_q'
/usr/local/lib/libavformat.a(utils.o)(.text+0x4387):/root/ffmpeg/libavformat/utils.c:1599: more undefined references to `av_rescale_q' follow
/usr/local/lib/libavformat.a(utils.o)(.text+0x4b8b): In function `compute_pkt_fields2':
/root/ffmpeg/libavformat/utils.c:2317: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(utils.o)(.text+0x5948): In function `dump_format':
/root/ffmpeg/libavformat/utils.c:2621: undefined reference to `ff_gcd'
/usr/local/lib/libavformat.a(utils.o)(.text+0x5b8a):/root/ffmpeg/libavformat/utils.c:2608: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(mpeg.o)(.text+0x23f0): In function `output_packet':
/root/ffmpeg/libavformat/mpeg.c:1062: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(mpeg.o)(.text+0x2a59): In function `mpeg_mux_write_packet':
/root/ffmpeg/libavformat/mpeg.c:1185: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x3bb): In function `ffm_write_header':
/root/ffmpeg/libavformat/ffm.c:186: undefined reference to `av_dbl2int'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x3d1):/root/ffmpeg/libavformat/ffm.c:187: undefined reference to `av_dbl2int'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x3ea):/root/ffmpeg/libavformat/ffm.c:188: undefined reference to `av_dbl2int'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x403):/root/ffmpeg/libavformat/ffm.c:189: undefined reference to `av_dbl2int'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x4b0):/root/ffmpeg/libavformat/ffm.c:201: undefined reference to `av_dbl2int'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x143a): In function `ffm_read_header':
/root/ffmpeg/libavformat/ffm.c:519: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x1451):/root/ffmpeg/libavformat/ffm.c:520: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x1465):/root/ffmpeg/libavformat/ffm.c:521: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x147c):/root/ffmpeg/libavformat/ffm.c:522: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(ffm.o)(.text+0x1527):/root/ffmpeg/libavformat/ffm.c:534: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(img.o)(.text+0x4c2): In function `img_read_packet':
/root/ffmpeg/libavformat/img.c:235: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(raw.o)(.text+0x3b9): In function `pcm_read_seek':
/root/ffmpeg/libavformat/raw.c:198: undefined reference to `av_rescale_rnd'
/usr/local/lib/libavformat.a(raw.o)(.text+0x405):/root/ffmpeg/libavformat/raw.c:205: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(avienc.o)(.text+0x403): In function `ff_parse_specific_params':
/root/ffmpeg/libavformat/avienc.c:299: undefined reference to `ff_gcd'
/usr/local/lib/libavformat.a(avienc.o)(.text+0x43d):/root/ffmpeg/libavformat/avienc.c:299: undefined reference to `ff_gcd'
/usr/local/lib/libavformat.a(avienc.o)(.text+0x482):/root/ffmpeg/libavformat/avienc.c:299: undefined reference to `ff_gcd'
/usr/local/lib/libavformat.a(avienc.o)(.text+0x80f): In function `avi_write_header':
/root/ffmpeg/libavformat/avienc.c:299: undefined reference to `ff_gcd'
/usr/local/lib/libavformat.a(avienc.o)(.text+0x1390): In function `avi_write_idx1':
/root/ffmpeg/libavformat/avienc.c:299: undefined reference to `ff_gcd'
/usr/local/lib/libavformat.a(avidec.o)(.text+0x308): In function `avi_read_packet':
/root/ffmpeg/libavformat/avidec.c:489: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(avidec.o)(.text+0x350):/root/ffmpeg/libavformat/avidec.c:499: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(avidec.o)(.text+0x186f): In function `avi_read_seek':
/root/ffmpeg/libavformat/avidec.c:858: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(mov.o)(.text+0x12fc): In function `mov_read_stsd':
/root/ffmpeg/libavformat/mov.c:1068: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(mov.o)(.text+0x19b1): In function `mov_read_stts':
/root/ffmpeg/libavformat/mov.c:1218: undefined reference to `ff_gcd'
/usr/local/lib/libavformat.a(mov.o)(.text+0x25b1): In function `mov_read_packet':
/root/ffmpeg/libavformat/mov.c:1681: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(dv.o)(.text+0x1593): In function `dv_read_header':
/root/ffmpeg/libavformat/dv.c:858: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(dv.o)(.text+0x1858): In function `dv_read_seek':
/root/ffmpeg/libavformat/dv.c:895: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(yuv4mpeg.o)(.text+0x8e): In function `yuv4_write_packet':
/root/ffmpeg/libavformat/yuv4mpeg.c:44: undefined reference to `av_reduce'
/usr/local/lib/libavformat.a(yuv4mpeg.o)(.text+0x5c6): In function `yuv4_read_header':
/root/ffmpeg/libavformat/yuv4mpeg.c:333: undefined reference to `av_reduce'
/usr/local/lib/libavformat.a(4xm.o)(.text+0x4ec): In function `fourxm_read_header':
/root/ffmpeg/libavformat/4xm.c:130: undefined reference to `av_int2flt'
/usr/local/lib/libavformat.a(flvdec.o)(.text+0x2d7): In function `flv_read_packet':
/root/ffmpeg/libavformat/flvdec.c:95: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(flvdec.o)(.text+0x523):/root/ffmpeg/libavformat/flvdec.c:105: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(nut.o)(.text+0x1c2d): In function `nut_write_packet':
/root/ffmpeg/libavformat/nut.c:723: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(nut.o)(.text+0x1c7e):/root/ffmpeg/libavformat/nut.c:133: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(nut.o)(.text+0x422a): In function `nut_read_packet':
/root/ffmpeg/libavformat/nut.c:133: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(nut.o)(.text+0x4896): In function `nut_read_timestamp':
/root/ffmpeg/libavformat/nut.c:133: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(matroska.o)(.text+0x36d): In function `ebml_read_float':
/root/ffmpeg/libavformat/matroska.c:614: undefined reference to `av_int2flt'
/usr/local/lib/libavformat.a(matroska.o)(.text+0x393):/root/ffmpeg/libavformat/matroska.c:616: undefined reference to `av_int2dbl'
/usr/local/lib/libavformat.a(nsvdec.o)(.text+0x328): In function `nsv_parse_NSVs_header':
/root/ffmpeg/libavformat/nsvdec.c:452: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(aiff.o)(.text+0x66): In function `get_aiff_header':
/root/ffmpeg/libavformat/aiff.c:130: undefined reference to `av_ext2dbl'
/usr/local/lib/libavformat.a(aiff.o)(.text+0x365): In function `aiff_write_header':
/root/ffmpeg/libavformat/aiff.c:217: undefined reference to `av_dbl2ext'
/usr/local/lib/libavformat.a(movenc.o)(.text+0x31b6): In function `mov_write_trailer':
/root/ffmpeg/libavformat/movenc.c:856: undefined reference to `av_rescale_rnd'
/usr/local/lib/libavformat.a(movenc.o)(.text+0x35a9):/root/ffmpeg/libavformat/movenc.c:740: undefined reference to `av_rescale_rnd'
/usr/local/lib/libavformat.a(movenc.o)(.text+0x3726):/root/ffmpeg/libavformat/movenc.c:787: undefined reference to `av_rescale_rnd'
/usr/local/lib/libavformat.a(asf-enc.o)(.text+0x152f): In function `asf_write_packet':
/root/ffmpeg/libavformat/asf-enc.c:743: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(rtp.o)(.text+0xba8): In function `rtp_write_packet':
/root/ffmpeg/libavformat/rtp.c:765: undefined reference to `av_rescale'
/usr/local/lib/libavformat.a(rtp.o)(.text+0x11e3):/root/ffmpeg/libavformat/rtp.c:740: undefined reference to `av_rescale'
/usr/local/lib/libavcodec.a(utils.o)(.text+0x125c): In function `avcodec_string':
/root/ffmpeg/libavcodec/utils.c:1116: undefined reference to `ff_gcd'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x285f): In function `MPV_encode_init':
/root/ffmpeg/libavcodec/mpegvideo.c:1104: undefined reference to `ff_gcd'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x2914): In function `MPV_encode_init':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x4028): In function `draw_arrow':
/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x12205): In function `encode_mb':
/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x12770):/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x128ed):/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x12a69):/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(mpegvideo.o)(.text+0x12bf5):/root/ffmpeg/libavutil/common.h:443: more undefined references to `ff_sqrt_tab' follow
/usr/local/lib/libavcodec.a(mpegaudio.o)(.text+0xdaf): In function `MPA_encode_frame':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(ac3enc.o)(.text+0x1fd2): In function `AC3_encode_frame':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(ac3enc.o)(.text+0x2502):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(mjpeg.o)(.text+0x24c5): In function `mjpeg_encode_mb':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(mjpeg.o)(.text+0x25e2):/root/ffmpeg/libavutil/common.h:384: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(mjpeg.o)(.text+0x2690):/root/ffmpeg/libavutil/common.h:384: more undefined references to `ff_log2_tab' follow
/usr/local/lib/libavcodec.a(motion_est.o)(.text+0x64): In function `ff_sqrt':
/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(mpeg12.o)(.text+0x298a): In function `ff_mpeg1_encode_init':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(mpeg12.o)(.text+0x2c49): In function `mpeg1_encode_block':
/root/ffmpeg/libavutil/common.h:384: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(mpeg12.o)(.text+0x2fcb):/root/ffmpeg/libavutil/common.h:384: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(mpeg12.o)(.text+0x8561): In function `mpeg_decode_frame':
/root/ffmpeg/libavcodec/mpeg12.c:2112: undefined reference to `av_reduce'
/usr/local/lib/libavcodec.a(mpeg12.o)(.text+0x85c2):/root/ffmpeg/libavcodec/mpeg12.c:2130: undefined reference to `av_div_q'
/usr/local/lib/libavcodec.a(mpeg12.o)(.text+0x9194):/root/ffmpeg/libavcodec/mpeg12.c:2107: undefined reference to `av_d2q'
/usr/local/lib/libavcodec.a(g726.o)(.text+0x87): In function `g726_init':
/root/ffmpeg/libavcodec/g726.c:273: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(g726.o)(.text+0x25b): In function `g726_encode_frame':
/root/ffmpeg/libavutil/common.h:384: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(g726.o)(.text+0x425):/root/ffmpeg/libavutil/common.h:384: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(g726.o)(.text+0x49a):/root/ffmpeg/libavutil/common.h:384: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(g726.o)(.text+0x651):/root/ffmpeg/libavutil/common.h:384: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(g726.o)(.text+0x7fd):/root/ffmpeg/libavutil/common.h:384: more undefined references to `ff_log2_tab' follow
/usr/local/lib/libavcodec.a(h263.o)(.text+0x1569c): In function `h263_decode_picture_header':
/root/ffmpeg/libavcodec/h263.c:5164: undefined reference to `ff_gcd'
/usr/local/lib/libavcodec.a(h263.o)(.text+0x16b3d): In function `ff_mpeg4_decode_picture_header':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(cook.o)(.text+0x20cb): In function `cook_decode_init':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(cook.o)(.text+0x2102):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(ffv1.o)(.text+0x44): In function `put_symbol':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(ffv1.o)(.text+0x2ebb): In function `decode_frame':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(ffv1.o)(.text+0x3080):/root/ffmpeg/libavutil/common.h:370: more undefined references to `ff_log2_tab' follow
/usr/local/lib/libavcodec.a(h264.o)(.text+0x815d): In function `decode_slice_header':
/root/ffmpeg/libavcodec/h264.c:4342: undefined reference to `av_reduce'
/usr/local/lib/libavcodec.a(loco.o)(.text+0xcf): In function `loco_decode_plane':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(loco.o)(.text+0x182):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(loco.o)(.text+0x517):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(loco.o)(.text+0x5ca):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(loco.o)(.text+0x850):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(loco.o)(.text+0x906):/root/ffmpeg/libavutil/common.h:370: more undefined references to `ff_log2_tab' follow
/usr/local/lib/libavcodec.a(snow.o)(.text+0x7b6c): In function `encode_q_branch':
/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(snow.o)(.text+0x7b8e):/root/ffmpeg/libavutil/common.h:443: undefined reference to `ff_sqrt_tab'
/usr/local/lib/libavcodec.a(snow.o)(.text+0x872c): In function `encode_q_branch2':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(snow.o)(.text+0x8767):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(snow.o)(.text+0x9654): In function `decode_q_branch':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(snow.o)(.text+0x9693):/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(snow.o)(.text+0xab1e): In function `get_block_rd':
/root/ffmpeg/libavutil/common.h:370: undefined reference to `ff_log2_tab'
/usr/local/lib/libavcodec.a(snow.o)(.text+0xab59):/root/ffmpeg/libavutil/common.h:370: more undefined references to `ff_log2_tab' follow
collect2: ld returned 1 exit status
make: *** [motion] Error 1
[root@asterisk1 motion-3.2.5]#
Environment
Motion version: |
3.2.5 |
ffmpeg version: |
ffmpeg-cvs-20060306-certified-with-motion-3.2.5.tar |
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
CentOS4 |
--
MortenHHansen - 04 Apr 2007
Answer
In the Makefile look for the line that starts with 'LIBS' and if it does not contain -lavutil try adding it and run make again.
--
AndrewHamilton - 04 Apr 2007
That's a well known issue with a bad ffmpeg package.
--
AngelCarpintero - 01 Jan 2008