Page 1 of 1

undefined symbol from built 0.9 linux

Posted: 15 Aug 2008 07:20
by hce
Hi,

I've built the 0.9 on Linux, but could not load the avcodec due to undefined symbo, what is missing here?
:
[00000001] main libvlc warning: cannot load module `/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/codec/libavcodec_plugin.so' (/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/codec/libavcodec_plugin.so: undefined symbol: uncompress)
[00000001] main libvlc warning: cannot load module `/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/demux/libavformat_plugin.so' (/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/demux/libavformat_plugin.so: undefined symbol: avcodec_init)
[00000001] main libvlc warning: cannot load module `/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/video_filter/libswscale_plugin.so' (/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/video_filter/libswscale_plugin.so: undefined symbol: av_free)
:

Re: undefined symbol from built 0.9 linux

Posted: 15 Aug 2008 16:26
by RĂ©mi Denis-Courmont
Looks like your ffmpeg build is hosed.

Re: undefined symbol from built 0.9 linux

Posted: 16 Aug 2008 02:38
by hce
Looks like your ffmpeg build is hosed.
Yes I built ffmpeg in my local directory, but I can build and play audiol and video from 0.8 VLC using the same ffmpeg. The problem is only for 0.9 which can be built but cannot play any video and audio due to missing symbol of the avcodec. If the 0.8 works but 0.9 does not using the same ffmpeg, isn't the problem of the 0.9? Is there anyway to check those undefined symbols in ffmpeg binary?

Thank you.

Re: undefined symbol from built 0.9 linux

Posted: 19 Aug 2008 08:30
by hce
Looks like your ffmpeg build is hosed.
I updated and re-compiled a latest ffmpeg from ffmpeg svn source tree today (FFmpeg version SVN-r14829). And I've also updated and compiled vlc from git (Based upon Git commit [32e1843f33]). But running vlc is still with the following undefined symbols. Could anyone please help?

[00000001] main libvlc warning: cannot load module `/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/codec/libavcodec_plugin.so' (/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/codec/libavcodec_plugin.so: undefined symbol: uncompress)
[00000001] main libvlc warning: cannot load module `/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/demux/libavformat_plugin.so' (/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/demux/libavformat_plugin.so: undefined symbol: avcodec_init)
[00000001] main libvlc warning: cannot load module `/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/video_filter/libswscale_plugin.so' (/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc/video_filter/libswscale_plugin.so: undefined symbol: av_freep)

Re: undefined symbol from built 0.9 linux

Posted: 19 Aug 2008 14:13
by xtophe
Have you "make install" ffmpeg and its libs ?

how do you indicate to vlc's configure where to find ffmpeg. if you use pkg-config it should work alright.

Re: undefined symbol from built 0.9 linux

Posted: 20 Aug 2008 04:07
by hce
Have you "make install" ffmpeg and its libs ?

how do you indicate to vlc's configure where to find ffmpeg. if you use pkg-config it should work alright.
In ffmpeg, i set "./configure --prefix=/home/Ffmpeg/Install". After make, I did make install, all files were installed in /home/Ffmpeg/Install

I also set up "export PKG_CONFIG_PATH=/home/Ffmpeg/Install/lib/pkgconfig:/usr/lib/pkgconfig". Calling pkg-config command, it displays following FFMPEG:

libavcodec libavcodec - FFmpeg codec library
libswscale libswscale - FFmpeg image rescaling library
libpostproc libpostproc - FFmpeg post processing library
libavformat libavformat - FFmpeg container format library
libavdevice libavdevice - FFmpeg device handling library
libavutil libavutil - FFmpeg utility library

Many people pointed me it might be the problem of PKG_CONFIG_PATH setting, but it seems to me it was not that the vlc could not find libavcodec and other FFmpeg libraries, it was the problem that the vlc could not load libavcodec and other shared libraries due to undefined symbols. I asked FFmpeg mailing list for the undefined symbols, but they thought it was vlc problem, not FFmpeg problem. Is there anyway to trace down this problem separatedly in vlc and ffmpeg? I've tried to build the VLC in three linux distributors, Debian, FC7 and CentOS, all had same problem with undefined symbols.

Re: undefined symbol from built 0.9 linux

Posted: 20 Aug 2008 04:08
by hce
Have you "make install" ffmpeg and its libs ?

how do you indicate to vlc's configure where to find ffmpeg. if you use pkg-config it should work alright.
In ffmpeg, i set "./configure --prefix=/home/Ffmpeg/Install". After make, I did make install, all files were installed in /home/Ffmpeg/Install

I also set up "export PKG_CONFIG_PATH=/home/Ffmpeg/Install/lib/pkgconfig:/usr/lib/pkgconfig". Calling pkg-config command, it displays following FFMPEG:

libavcodec libavcodec - FFmpeg codec library
libswscale libswscale - FFmpeg image rescaling library
libpostproc libpostproc - FFmpeg post processing library
libavformat libavformat - FFmpeg container format library
libavdevice libavdevice - FFmpeg device handling library
libavutil libavutil - FFmpeg utility library

Many people pointed me it might be the problem of PKG_CONFIG_PATH setting, but it seems to me it was not that the vlc could not find libavcodec and other FFmpeg libraries, it was the problem that the vlc could not load libavcodec and other shared libraries due to undefined symbols. I asked FFmpeg mailing list for the undefined symbols, but they thought it was vlc problem, not FFmpeg problem. Is there anyway to trace down this problem separatedly in vlc and ffmpeg? I've tried to build the VLC in three linux machines, Debian, FC7 and CentOS, all had same problem with undefined symbols. It was really a myth to me.

Re: undefined symbol from built 0.9 linux

Posted: 20 Aug 2008 11:51
by xtophe
Does pkg-config --libs libavcodec gives -lz in the list ?

Could you paste the line relevant to libavcodec, libavformat and libswscale from vlc-config?

Re: undefined symbol from built 0.9 linux

Posted: 21 Aug 2008 01:14
by hce
Does pkg-config --libs libavcodec gives -lz in the list ?

Could you paste the line relevant to libavcodec, libavformat and libswscale from vlc-config?
$ pkg-config --libs libavcodec
-L/home/project/work/Tools/Media/Ffmpeg/Install/lib -lavcodec

Is it ok only with -l no -lz?

Did you mean to paste above line and other avutil etc. to vlc-config? Or did you mean that vlc-config contains lines to libavcodec, libavformat and libswscale? I could not find them. Please see following vlc-config:

#!/bin/sh

prefix="/home/project/work/project/MediaPlayer/0.9/Install"
exec_prefix="${prefix}"
exec_prefix_set=no
datarootdir="${prefix}/share"

release="no"
debug="yes"
gprof="no"
cprof="no"
optim="speed"

Re: undefined symbol from built 0.9 linux

Posted: 21 Aug 2008 16:55
by xtophe
[quote="hce$ pkg-config --libs libavcodec
-L/home/project/work/Tools/Media/Ffmpeg/Install/lib -lavcodec

Is it ok only with -l no -lz?
[/quote]
It isn't it should have all the others libs libavcodec depends on like zlib
Did you mean to paste above line and other avutil etc. to vlc-config? Or did you mean that vlc-config contains lines to libavcodec, libavformat and libswscale? I could not find them. Please see following vlc-config:
I meant: Read at vlc-config, understand what it does roughtly and look at the place it sets the ldflags and cflags for the libavcodec module

Re: undefined symbol from built 0.9 linux

Posted: 22 Aug 2008 11:22
by hce
I meant: Read at vlc-config, understand what it does roughtly and look at the place it sets the ldflags and cflags for the libavcodec module
I added -DDATA_PATH and -DPLUGIN_PATH to the vlc-config cflags and added ffmpeg with ldconfig:

$ ./vlc-config --cflags
-I/home/project/work/project/MediaPlayer/0.9/Install/include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -DLOCALEDIR="/home/project/work/project/MediaPlayer/0.9/Install/share/locale" -DDATA_PATH="/home/project/work/project/MediaPlayer/0.9/Install/share/vlc" -DPLUGIN_PATH="/home/project/work/project/MediaPlayer/0.9/Install/lib/vlc" -DDEBUG -g -O2 -ffast-math -funroll-loops -mtune=pentium2

But the undefined symbos are still there.

I had a deep look at the problem, for example, the one of undefined symbol: av_freep in libswscale_plugin.so was indeed in my FFMPEG libavutil.a. But the libswscale_plugin.so was not compiled and linked by -lavutil in libswscale_plugin.la. I added -lavutil to libswscale_plugin.la, but it didn't recompile the libswscale_plugin.so. How can I make changes in vlc-config to link libswscale_plugin.so to -lavutil? Or, how can I force the libswscale_plugin.so be re-compiled in make command?

Re: undefined symbol from built 0.9 linux

Posted: 20 Sep 2008 23:25
by fpostma
I think it might have something to with the pc file:

$ cat libavcodec.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=$(PREFIX)/lib
includedir=$(PREFIX)/include

Name: libavcodec
Description: FFmpeg codec library
Version: 51.56.0
Requires: libavutil = 49.6.0
Conflicts:
Libs: -L${libdir} -lavcodec
Libs.private: -lz -pthread -lm -lmp3lame -lm -ldl
Cflags: -I${includedir}

The libraries you need to add to 'libs' for vlc building/linking are in Libs.private. I'm not sure WHY but that seem to be the reason vlc configure doesn't catch them.
(and yes, if you add only -lz to those libs, you get another error this time about lame ;-)