Menu

#233 libmp3lame doesn't link against libm

Compatibility
closed
5
2006-10-07
2006-09-19
No

This evidenced itself in the config.log while
configuring kdemultimedia.

<configure output>
checking for lame/lame.h... yes
checking for lame_init in -lmp3lame... no
configure: error: --with-lame was given, but test for
lame failed
</configure output>

<relavent config.log from kdemultimedia>
configure:35824: checking for lame/lame.h
configure:35831: result: yes
configure:35860: checking for lame_init in -lmp3lame
configure:35890: gcc -o conftest -std=iso9899:1990 -W
-Wall -Wchar-subscripts -Wshadow -Wpointer-arith
-Wmissing-prototypes -Wwrite-strings
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DNDEBUG -O2 -O
-march=k8 -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m64
-fPIC -DPIC -pipe -DPIC -fPIC -Os -Wformat-security
-Wmissing-format-attribute -DQT_THREAD_SUPPORT
-D_REENTRANT -z combreloc -s -L/usr/lib -L/usr/lib64
-Wl,--as-needed -Wl,--enable-new-dtags conftest.c
-lmp3lame -lm >&5
/usr/lib/libmp3lame.so: undefined reference to `log'
/usr/lib/libmp3lame.so: undefined reference to `sqrt'
/usr/lib/libmp3lame.so: undefined reference to `ceil'
/usr/lib/libmp3lame.so: undefined reference to `floor'
/usr/lib/libmp3lame.so: undefined reference to `sqrtf'
/usr/lib/libmp3lame.so: undefined reference to `cos'
/usr/lib/libmp3lame.so: undefined reference to `sin'
/usr/lib/libmp3lame.so: undefined reference to `pow'
/usr/lib/libmp3lame.so: undefined reference to `log10'
/usr/lib/libmp3lame.so: undefined reference to `exp'
/usr/lib/libmp3lame.so: undefined reference to `tan'
/usr/lib/libmp3lame.so: undefined reference to `atan'
/usr/lib/libmp3lame.so: undefined reference to `floorf'
collect2: ld returned 1 exit status
configure:35896: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "kdemultimedia"
| #define VERSION "3.5.4"
| #ifdef __cplusplus
| extern "C" void std::exit (int) throw (); using
std::exit;
| #endif
| #define KDELIBSUFF ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_SGI_STL 1
| #define HAVE_CRYPT 1
| #define kde_socklen_t socklen_t
| #define ksize_t socklen_t
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_BITYPES_H 1
| #define HAVE_RES_INIT 1
| #define HAVE_RES_INIT 1
| #define HAVE_RES_INIT_PROTO 1
| #define SIZEOF_INT 4
| #define SIZEOF_SHORT 2
| #define SIZEOF_LONG 8
| #define SIZEOF_CHAR_P 8
| #define SIZEOF_SIZE_T 8
| #define SIZEOF_UNSIGNED_LONG 8
| #define HAVE_VSNPRINTF 1
| #define HAVE_SNPRINTF 1
| #define HAVE_LIBZ 1
| #define HAVE_LIBPNG 1
| #define HAVE_LIBJPEG 1
| #define HAVE_LIBPTHREAD 1
| #define HAVE_DIRENT_H 1
| #define STDC_HEADERS 1
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_FEATURES_H 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_LINUX_AWE_VOICE_H 1
| #define HAVE_SYS_SEM_H 1
| #define HAVE_STRING_H 1
| #define HAVE_GETOPT_H 1
| #define HAVE_LINUX_CDROM_H 1
| #define HAVE_USLEEP 1
| #define HAVE_SNPRINTF 1
| #define TIME_WITH_SYS_TIME 1
| #define RETSIGTYPE void
| #define HAVE_OGG_VORBIS 1
| #define HAVE_VORBIS 2
| #define OGG_VORBIS 1
| #define HAVE_SYS_SOUNDCARD_H 1
| #define HAVE_SYS_ASOUNDLIB_H 1
| #define HAVE_ALSA_ASOUNDLIB_H 1
| #define HAVE_LIBASOUND2 1
| #define HAVE_ARTS_LIBASOUND2 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an
error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return
type of a gcc2
| builtin and then its argument prototype would
still apply. */
| char lame_init ();
| int
| main ()
| {
| lame_init ();
| ;
| return 0;
| }
configure:35922: result: no
configure:35943: error: --with-lame was given, but test
for lame failed
</relavent config.log from kdemultimedia>

Thanks :)

Discussion

  • Anonymous

    Anonymous - 2006-09-19

    Logged In: YES
    user_id=682016

    Oh, btw, I did get this to compile by adding by -lm to the
    LDFLAGS as I built it. (well technically as the package
    manager built it, but the end result is the same :) )

     
  • Alexander Leidinger

    • assigned_to: nobody --> aleidinger
    • status: open --> pending
     
  • Alexander Leidinger

    Logged In: YES
    user_id=90585

    The log you quote here contains -lm, so I'm a little bit
    puzzled how the log as is can look like this.

     
  • Anonymous

    Anonymous - 2006-09-22

    Logged In: YES
    user_id=682016

    <log>
    gcc -o conftest -std=iso9899:1990 -W
    -Wall -Wchar-subscripts -Wshadow -Wpointer-arith
    -Wmissing-prototypes -Wwrite-strings
    -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DNDEBUG -O2 -O
    -march=k8 -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m64
    -fPIC -DPIC -pipe -DPIC -fPIC -Os -Wformat-security
    -Wmissing-format-attribute -DQT_THREAD_SUPPORT
    -D_REENTRANT -z combreloc -s -L/usr/lib -L/usr/lib64
    -Wl,--as-needed -Wl,--enable-new-dtags conftest.c
    -lmp3lame -lm >&5
    </log>
    talking about that?

    I believe that means that conftest.c is linked against
    -lmp3lame and -lm
    I don't think that it applies to the libs that lame built.

     
  • Anonymous

    Anonymous - 2006-09-22
    • status: pending --> open
     
  • Alexander Leidinger

    • status: open --> pending
     
  • Alexander Leidinger

    Logged In: YES
    user_id=90585

    Yes, this is what I'm talking about. And after this part it
    complains about the missing symbols from libm. But conftest
    is linked against libm, and it is done after linking to
    libmp3lame. So the linker should be able to satisfy the
    dependencies by using the symbols from libm. But it doesn't
    do it. That's strange.

    I see -L/usr/lib -L/usr/lib64, can I assume you are using an
    amd64 linux system? Are you sure it doesn't pick up the
    wrong libm (32bit instead of 64bit) and has problems because
    of this? Can you trace down where the -L/usr/lib comes from
    in this case? I can't remember having something in LAME
    which adds this... also have a look at libmp3lame.la if it
    is there perhaps? If it is in the .la, then I don't know how
    to solve this issue. I'm a FreeBSD user and we don't have a
    lib64 directory (we have 32bit compatibility somewhere else,
    this prevents such library hell).

     
  • Anonymous

    Anonymous - 2006-09-22

    Logged In: YES
    user_id=682016

    Yep pure x86_64 :)
    Luckily (or unluckily as it may be) I don't have a
    /usr/lib64 really, it's just a symlink to /usr/lib. The
    32-bit compatibility stuff is isoloated to /opt/emul32

    <>
    root@raziel:~# ls -dl /usr/lib
    drwxr-xr-x 83 root root 125248 Sep 22 09:42 /usr/lib
    root@raziel:~# ls -dl /usr/lib64
    lrwxrwxrwx 1 root root 3 Aug 13 12:52 /usr/lib64 -> lib
    </>

    I'm only installing the 64 bit versions of libmp3lame. In
    order to link against the 32-bit libs it'd need -L
    /opt/emul32 I think.

     
  • Anonymous

    Anonymous - 2006-09-22
    • status: pending --> open
     
  • Alexander Leidinger

    Logged In: YES
    user_id=90585

    Sorry, but this still look like a problem on your system.
    The math lib is linked with libmp3lame in the above log, so
    it should work.

    I looked at how gstreamer handles this and they add libm to
    AC_CHECK_LIB (as the 5th argument), and it configures just
    fine here.

    While we could add libm to the (ELF-)dependencies, so that
    it gets picked up automatically, I think it's more a problem
    with kdemultimedia (if they don't add libm in the test), or
    a problem on your system.

    So far I can't see any evidence here which should block the
    release of 3.97 at the weekend. Feel free to speak up and
    try to convince us that it is a generic problem.

     
  • Alexander Leidinger

    • status: open --> pending
     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.