Menu

#60 Missing library when linking

None
wont-fix
None
5
2024-08-03
2021-02-03
No

Hi,

Some binaries (y4mutils, mplex and lavtoolsà fails to link with system or internal library (libdv, libquicktime or libmjpegutils.la

Attached patch fix this issue.

You can also check Debian patches in this directory.
https://salsa.debian.org/multimedia-team/mjpegtools/-/tree/master/debian/patches

libtool: link: (cd ".libs" && rm -f "liblavplay-2.2.so.0" && ln -s "liblavplay-2.2.so.0.0.0" "liblavplay-2.2.so.0")
/usr/bin/ld: lav2yuv-lav_common.o: undefined reference to symbol 'dv_decoder_new'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdv.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
1 Attachments

Discussion

  • Steven Schultz

    Steven Schultz - 2021-02-03

    adding LIBDV or LIBQUICKTIME is redundant I think. NO other platform has reported a linking issue (ranging form SuSE to macOS).

    Looking at lav2yuv for example we see that it uses 'liblavfile.la' and that earlier in the Makefile.am we see at line 44:

    liblavfile_la_LIBADD = $(LIBQUICKTIME_LIBS) $(JPEG_LIBS) $(LIBDV_LIBS) $(LIBMJPEGUTILS)

    and at line 146 LIBMJPEGUTILS and liblavfile.la (which included libdv) are BOTH included:

    lav2yuv_LDADD = $(LIBMJPEGUTILS) \
    liblavfile.la liblavjpeg.la

    so LIBDV, LIBQUICKTIME and LIBMJPEGUTILS are all included already. Adding another LIBDV should not be necessary.

    The link error given as an example mentions libdv.so.4 - so that tells me that LIBDV has indeed already been included! The error is truncated so we can not see anything after "DSO missing from c...". It is possible that an incorrect libdv.so.4 is installed.

    It should not be necessary to include LIBDV a 2nd time.

    The same analysis can be done for mplex and y4mtoqt.

    The necessary libraries are included already or the programs would have been failing to link for a very long time.

    At the present time I can't see the need to doubly include libraries. I feel there is something else is going on that should be fixed instead.

     

    Last edit: Steven Schultz 2021-02-04
  • Steven Schultz

    Steven Schultz - 2021-02-04

    Let us look and analyze the error message more closely:

    /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdv.so.4: error adding symbols

    NOTE: 1) this is "ld" (the linker" running
    2) "ld" explicitly mentions "libdv.so.4" and
    3) "ld" has an error adding (finding) the symbol dv_decoder_new

    So we have a linker that 1) does not scan a library (that it knows the name of) for a symbol and 2) insists that the library name be mentioned a 2nd time. That feels wrong.

    From a SuSE 15.2 (and macOS behaves the same way) system the linking of lav2yuv looks like this ( I have spaced the info so it does not fold incorrectly or become truncated):

    /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -pthread -Wall
    -Wunused -o lav2yuv lav2yuv-lav2yuv.o lav2yuv-lav_common.o
    ../utils/libmjpegutils.la liblavfile.la liblavjpeg.la -lm
    libtool: link: gcc -g -O2 -pthread -Wall -Wunused -o .libs/lav2yuv
    lav2yuv-lav2yuv.o lav2yuv-lav_common.o ../utils/.libs/libmjpegutils.so
    ./.libs/liblavfile.so -L/usr/local/lib64 /usr/local/lib64/libquicktime.so
    -lpthread -lz -ldl /usr/local/lib64/libdv.so
    ./.libs/liblavjpeg.so -ljpeg
    /usr/local/src/mjpegtools/utils/.libs/libmjpegutils.so -lm -pthread

    Look at the 3rd line from the bottom - you will see libdv.so

    I believe that either libtool or ld is misconfigured on a system that needs a library to be added a 2nd time.

    If it's been 7 years (and mjepgtools goes back MUCH further than that) since it became necessary to patch the build process for mjpegtools then that's when ld or libtool configuration was changed - best to fix the problem there.

    At this time I can't see adding the patch when other systems sail thru without a problem.

     
  • Steven Schultz

    Steven Schultz - 2024-08-03
    • status: open --> wont-fix
    • assigned_to: Steven Schultz
    • Group: -->
     

Log in to post a comment.