Opened 13 years ago

Closed 13 years ago

#1337 closed defect (fixed)

Link error in G711. G722, and G722.1 codecs are disabled (thanks Jean-Noël Rivasseau for the report)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-1.12
Component: unit-tests Version: 1.x-branch
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description

The following configure options:

--disable-g711-codec --enable-l16-codec --disable-g722-codec --disable-g7221-codec

will cause link errors in pjmedia-test:

../lib/libpjmedia-codec-i686-pc-linux-gnu.a(l16.o): In function `l16_recover':
l16.c:(.text+0x60e): undefined reference to `pjmedia_plc_generate'
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(l16.o): In function `l16_decode':
l16.c:(.text+0x6d6): undefined reference to `pjmedia_plc_save'
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(l16.o): In function
`l16_alloc_codec':
l16.c:(.text+0x966): undefined reference to `pjmedia_plc_create'
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(gsm.o): In function
`gsm_dealloc_codec':
gsm.c:(.text+0x40d): undefined reference to `pjmedia_plc_save'
gsm.c:(.text+0x42d): undefined reference to `pjmedia_plc_save'
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(gsm.o): In function
`gsm_codec_recover':
gsm.c:(.text+0x4fe): undefined reference to `pjmedia_plc_generate'
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(gsm.o): In function
`gsm_codec_decode':
gsm.c:(.text+0x5e1): undefined reference to `pjmedia_plc_save'
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(gsm.o): In function
`gsm_alloc_codec':
gsm.c:(.text+0x9f3): undefined reference to `pjmedia_plc_create'
collect2: ld returned 1 exit status

This problem was originally reported in http://bugs.gentoo.org/show_bug.cgi?id=364249

Change History (1)

comment:1 Changed 13 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

(In [3681]) Fixed #1337 re: link error with the PLC stuff if G.711 codec is disabled.

This basically is caused by the problem with library order in the Makefile. Since libpjmedia (which contains the PLC code) is specified first before the third party libs (which the codecs reside), the PLC didn't get picked up by the linker. It works if G.711 is enabled, because G.711 lives in libpjmedia.

The real problem is because there is a circular dependency between pjmedia and third party libraries. The real solution would be to break down third party libraries into individual lib and arrange the link order correctly. This would need a bit of work in the Makefile though.

For now, let's just hack pjmedia-test so that it links with the PLC if G.711 is disabled.

Note: See TracTickets for help on using tickets.