[XviD-devel] libxvidcore.so not found + suggested fix

Steven M. Schultz sms at 2BSD.COM
Wed Feb 19 10:56:24 CET 2003


Hi!

	I'm using one of the *BSD* variants (BSD/OS 4.3.1 to be precise) and
	was surprised to get a "libxvidcore.so not found" error when running
	'mencoder' (MPlayer's encoder which uses libxvidcore):

moe.18-> mencoder
mencoder: can't load library 'libxvidcore.so'

moe.20-> objdump -p /usr/local/lib/libxvidcore.so

/usr/local/lib/libxvidcore.so:     file format elf32-i386

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x00086684 memsz 0x00086684 flags r-x
    LOAD off    0x000866c0 vaddr 0x000876c0 paddr 0x000876c0 align 2**12
         filesz 0x00003de8 memsz 0x0006dda0 flags rw-
 DYNAMIC off    0x0008a410 vaddr 0x0008b410 paddr 0x0008b410 align 2**2
         filesz 0x00000098 memsz 0x00000098 flags rw-

Dynamic Section:
  NEEDED      libc.so.2
  NEEDED      libm.so
  NEEDED      libgcc.so.1
  INIT        0x9cbc
  FINI        0x8013c
  HASH        0x94
  STRTAB      0x2bc8
  SYMTAB      0xc88
  STRSZ       0x1e4b
  SYMENT      0x10
  PLTGOT      0x8acfc
  PLTRELSZ    0x478
  PLTREL      0x11
  JMPREL      0x9844
  REL         0x4a14
  RELSZ       0x4e30
  RELENT      0x8
  TEXTREL     0x0

	The problem is that the shared library does not have a "soname" for
	the dynamic linker to find.   When creating a shared library it
	seems to be necessary to add use "-soname libxvidcore.so -shared"

	This small patch does rely on using 'gcc' to pass thru to the linker
	the appropriate flags:

--- configure.in.dist	Sun Feb 16 21:17:45 2003
+++ configure.in	Wed Feb 19 10:43:15 2003
@@ -247,7 +247,7 @@
 case "$target_os" in
      *bsd*|linux*|irix*|solaris*)
 	AC_MSG_RESULT([-shared -lc -lm])
-	SPECIFIC_LDFLAGS="-shared -lc -lm"
+	SPECIFIC_LDFLAGS="-Wl,-soname -Wl,libxvidcore.so -shared -lc -lm"
 	SPECIFIC_CFLAGS="-fPIC"
 	;;
      [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]|mingw32|mks)

	After building the shared library with that change:

/usr/local/lib/libxvidcore.so:     file format elf32-i386

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x0008691c memsz 0x0008691c flags r-x
    LOAD off    0x00086940 vaddr 0x00087940 paddr 0x00087940 align 2**12
         filesz 0x00003df0 memsz 0x0006ddb8 flags rw-
 DYNAMIC off    0x0008a690 vaddr 0x0008b690 paddr 0x0008b690 align 2**2
         filesz 0x000000a0 memsz 0x000000a0 flags rw-
    NOTE off    0x00086904 vaddr 0x00086904 paddr 0x00086904 align 2**2
         filesz 0x00000018 memsz 0x00000018 flags r--

Dynamic Section:
  NEEDED      libc.so.2
  NEEDED      libm.so
  NEEDED      libgcc.so.1
  SONAME      libxvidcore.so
  INIT        0x9ee0
  FINI        0x803bc
  HASH        0xb4
  STRTAB      0x2cb0
  SYMTAB      0xcd0
  STRSZ       0x1ea0
  SYMENT      0x10
  PLTGOT      0x8af7c
  PLTRELSZ    0x488
  PLTREL      0x11
  JMPREL      0x9a58
  REL         0x4b50
  RELSZ       0x4f08
  RELENT      0x8
  TEXTREL     0x0

	Cheers,
	Steven Schultz


More information about the XviD-devel mailing list