#7594 closed defect (invalid)
Undefined references - compile error on Linux Mint
Reported by: | kybos | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
Various undefined references on linking.
How to reproduce:
I did exactly as described in "Compile FFmpeg for Ubuntu, Debian, or Mint" (https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu).
This is the output part where the errors start:
LD ffmpeg_g
libavformat/libavformat.a(rtsp.o): In function `ff_rtsp_connect':
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/rtsp.c:1888: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(asvdec.o): In function `asv2_decode_block':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvdec.c:147: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvdec.c:147: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvdec.o): In function `decode_frame':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvdec.c:231: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvenc.o): In function `asv2_put_bits':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvenc.c:40: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvenc.o): In function `put_bits':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/put_bits.h:198: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvenc.o):/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvenc.c:40: more undefined references to `ff_reverse' follow
libavcodec/libavcodec.a(tiertexseqv.o): In function `seq_decode_op1':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiertexseqv.c:111: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(tiff.o): In function `tiff_unpack_fax':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:489: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `deinvert_buffer':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:305: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `tiff_unpack_strip':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:637: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `deinvert_buffer':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:305: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `tiff_unpack_strip':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:626: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o):/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:663: more undefined references to `ff_reverse' follow
libavcodec/libavcodec.a(xsubdec.o): In function `decode_frame':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/xsubdec.c:158: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(xsubenc.o): In function `put_xsub_rle':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/xsubenc.c:45: undefined reference to `ff_log2_tab'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/xsubenc.c:45: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(dsd.o): In function `ff_dsd2pcm_translate':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/dsd.c:80: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(aacps_fixed.o): In function `ff_ps_read_data_fixed':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/aacps.c:208: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(aacps_float.o): In function `ff_ps_read_data':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/aacps.c:208: undefined reference to `ff_log2_tab'
libavformat/libavformat.a(matroskadec.o): In function `ebml_read_num':
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/matroskadec.c:843: undefined reference to `ff_log2_tab'
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/matroskadec.c:843: undefined reference to `ff_log2_tab'
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/matroskadec.c:843: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(bitstream.o): In function `bitswap_32':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(s302m.o): In function `s302m_decode_frame':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/s302m.c:165: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(s302m.o):/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/s302m.c:144: more undefined references to `ff_reverse' follow
collect2: error: ld returned 1 exit status
Makefile:108: recipe for target 'ffmpeg_g' failed
make: * [ffmpeg_g] Error 1
Change History (11)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Thanks.
As I wrote, I do exactly as described in the docu, which implies the download of the current ffmpeg snapshot, if I understand it correctly.
My input:
cd ~/ffmpeg_sources && wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && tar xjvf ffmpeg-snapshot.tar.bz2 && cd ffmpeg && PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --extra-libs="-lpthread -lm" --bindir="$HOME/bin" --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree && PATH="$HOME/bin:$PATH" make && make install && hash -r
gcc -v output:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
make V=1 ffmpeg (second run output):
make V=1 ffmpeg
gcc -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -L/home/xxx/ffmpeg_build/lib -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -o ffmpeg_g fftools/ffmpeg_opt.o fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o fftools/cmdutils.o fftools/ffmpeg.o -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lm -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lm -ldl -lpthread -lrt -lSDL2 -Wl,--no-undefined -lm -ldl -lasound -lm -ldl -lpthread -lpulse-simple -lpulse -lsndio -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lwayland-egl -lwayland-client -lwayland-cursor -lxkbcommon -lpthread -lrt -lsndio -lXv -lX11 -lXext -pthread -lm -lva -lass -lm -lharfbuzz -lm -lglib-2.0 -pthread -lpcre -pthread -lgraphite2 -lfontconfig -lexpat -lfreetype -lexpat -lfribidi -lfreetype -lpng16 -lm -lz -lm -lz -lfreetype -lpng16 -lm -lz -lm -lz -lm -lz -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -pthread -lm -lz -L/home/xxx/ffmpeg_build/lib -laom -lm -lpthread -lfdk-aac -lm -lmp3lame -lm -lopus -lm -lvorbis -lm -logg -lvorbisenc -lvorbis -lm -logg -lx264 -lpthread -lm -ldl -L/home/xxx/ffmpeg_build/lib -lx265 -lstdc++ -lm -lgcc_s -lgcc -lgcc_s -lgcc -lrt -ldl -lnuma -lva -lm -lm -lm -pthread -lva-drm -lva -lva-x11 -lva -lvdpau -lX11 -lm -lva -lXv -lX11 -lXext -lpthread -lm
libavformat/libavformat.a(rtsp.o): In function `ff_rtsp_connect':
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/rtsp.c:1888: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(asvdec.o): In function `asv2_decode_block':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvdec.c:147: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvdec.c:147: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvdec.o): In function `decode_frame':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvdec.c:231: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvenc.o): In function `asv2_put_bits':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvenc.c:40: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvenc.o): In function `put_bits':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/put_bits.h:198: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(asvenc.o):/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/asvenc.c:40: more undefined references to `ff_reverse' follow
libavcodec/libavcodec.a(tiertexseqv.o): In function `seq_decode_op1':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiertexseqv.c:111: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(tiff.o): In function `tiff_unpack_fax':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:489: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `deinvert_buffer':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:305: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `tiff_unpack_strip':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:637: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `deinvert_buffer':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:305: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o): In function `tiff_unpack_strip':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:626: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(tiff.o):/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/tiff.c:663: more undefined references to `ff_reverse' follow
libavcodec/libavcodec.a(xsubdec.o): In function `decode_frame':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/xsubdec.c:158: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(xsubenc.o): In function `put_xsub_rle':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/xsubenc.c:45: undefined reference to `ff_log2_tab'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/xsubenc.c:45: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(dsd.o): In function `ff_dsd2pcm_translate':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/dsd.c:80: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(aacps_fixed.o): In function `ff_ps_read_data_fixed':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/aacps.c:208: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(aacps_float.o): In function `ff_ps_read_data':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/aacps.c:208: undefined reference to `ff_log2_tab'
libavformat/libavformat.a(matroskadec.o): In function `ebml_read_num':
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/matroskadec.c:843: undefined reference to `ff_log2_tab'
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/matroskadec.c:843: undefined reference to `ff_log2_tab'
/home/xxx/ffmpeg_sources/ffmpeg/libavformat/matroskadec.c:843: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(bitstream.o): In function `bitswap_32':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/mathops.h:245: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(s302m.o): In function `s302m_decode_frame':
/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/s302m.c:165: undefined reference to `ff_reverse'
libavcodec/libavcodec.a(s302m.o):/home/xxx/ffmpeg_sources/ffmpeg/libavcodec/s302m.c:144: more undefined references to `ff_reverse' follow
collect2: error: ld returned 1 exit status
Makefile:108: recipe for target 'ffmpeg_g' failed
make: * [ffmpeg_g] Error 1
comment:4 by , 6 years ago
What do the following show?
$ nm libavutil/log2_tab.o $ nm libavutil/libavutil.a |grep ff_log2_tab
comment:5 by , 6 years ago
$ nm libavutil/log2_tab.o
0000000000000000 R ff_log2_tab
$ nm libavutil/libavutil.a |grep ff_log2_tab
0000000000000000 R ff_log2_tab
follow-up: 8 comment:7 by , 6 years ago
Yes, there are the files from my normal ffmpeg installation:
/usr/lib/x86_64-linux-gnu/libavutil.a
/usr/lib/x86_64-linux-gnu/libavutil.so
/usr/lib/x86_64-linux-gnu/libavutil.so.55
/usr/lib/x86_64-linux-gnu/libavutil.so.55.78.100
comment:8 by , 6 years ago
Replying to kybos:
Yes, there are the files from my normal ffmpeg installation:
/usr/lib/x86_64-linux-gnu/libavutil.a
/usr/lib/x86_64-linux-gnu/libavutil.so
Does linking work if you rename these two?
comment:9 by , 6 years ago
Unfortunately not, exactly the same error as before.
I renamed them so, I assume this should be sufficient:
sudo mv /usr/lib/x86_64-linux-gnu/libavutil.a /usr/lib/x86_64-linux-gnu/libavutil.a.bu sudo mv /usr/lib/x86_64-linux-gnu/libavutil.so /usr/lib/x86_64-linux-gnu/libavutil.so.bu
comment:10 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I tried the same again with the current snapshot and now it works (even without renaming the files from the standard installation).
Closing the ticket.
Please confirm that you test current FFmpeg git head, provide your configure line,
gcc -v
output, runmake V=1 ffmpeg
twice in a row and provide the console output of the second (!) run to make this a valid ticket.