Problem when building with --enable-shared in Linux

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem when building with --enable-shared in Linux

Stefano Sabatini
Hi all,

I'm configuring with:
configure --prefix=$HOME --enable-shared

and no other options.

The when linking ffmpeg_g I get:

gcc -L"/home/stefano/src/ffmpeg"/libavdevice
-L"/home/stefano/src/ffmpeg"/libavformat
-L"/home/stefano/src/ffmpeg"/libavcodec
-L"/home/stefano/src/ffmpeg"/libavutil -L/home/stefano/lib -rdynamic
-export-dynamic -Wl,--warn-common -Wl,--as-needed
-Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavcodec
-Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavformat
-Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavutil -Wl,-Bsymbolic -g
-o ffmpeg_g ffmpeg.o cmdutils.o -lavdevice -lavformat -lavcodec
-lavutil -lz -lm -ldl -ldl

(yes I aslo tried to remove the -L/home/stefano/lib option):

/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_comment'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_num_channels'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecSetConfiguration'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_YUVin'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecClose'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncGetCurrentConfiguration'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecGetCurrentConfiguration'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_header'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_block_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_comment_clear'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_wrote'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_comment_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_info_clear'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_comment_add_tag'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_headerout'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_encode_buffer'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncEncode'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecGetErrorMessage'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_close'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_info_clear'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_dsp_clear'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_VBR'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncGetDecoderSpecificInfo'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_setup_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncClose'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_bitrate_flushpacket'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_out_samplerate'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_packetout'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_brate'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_block_clear'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_setup_managed'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_get_framesize'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_encode_flush'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_ctl'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_setup_vbr'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_quality'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_info_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_clear'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_bitrate_addblock'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecOpen'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecDecode'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecInit'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_blockout'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_init_params'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_bWriteVbrTag'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncSetConfiguration'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_tables'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncOpen'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_comment_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_encode_buffer_interleaved'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_mode'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_buffer'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_in_samplerate'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_VBR_q'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_info_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_init'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecInit2'
/home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_comment_clear'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
stefano@geppetto ~/s/ffmpeg> find . -name '*.[ch]' | xargs grep vorbis_analysis…
                            …_blockout
./libavcodec/libvorbis.c:    while(vorbis_analysis_blockout(&context->vd, &context->vb) == 1) {
stefano@geppetto ~/s/ffmpeg> nm libavcodec/libavcodec.so | grep theora
0031d7a0 t theora_decode_init
00437a80 D theora_decoder

Why are all the symbols for the various lame, theora, faac
etc. libraries referenced here (although I'm not using --enable-lame,
... at all)?

Am I missing something obvious or am I hitting some bugs in the build
system?

Many thanks in advance, regards.
--
ffmpeg-user random tip #21
Create a video from a single image:
ffmpeg -loop_input -f image2 -i image.jpeg -t 20 image-movie.mpeg
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem when building with --enable-shared in Linux

Stefano Sabatini
On date Thursday 2007-12-27 11:01:59 +0100, Stefano Sabatini encoded:

> Hi all,
>
> I'm configuring with:
> configure --prefix=$HOME --enable-shared
>
> and no other options.
>
> The when linking ffmpeg_g I get:
>
> gcc -L"/home/stefano/src/ffmpeg"/libavdevice
> -L"/home/stefano/src/ffmpeg"/libavformat
> -L"/home/stefano/src/ffmpeg"/libavcodec
> -L"/home/stefano/src/ffmpeg"/libavutil -L/home/stefano/lib -rdynamic
> -export-dynamic -Wl,--warn-common -Wl,--as-needed
> -Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavcodec
> -Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavformat
> -Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavutil -Wl,-Bsymbolic -g
> -o ffmpeg_g ffmpeg.o cmdutils.o -lavdevice -lavformat -lavcodec
> -lavutil -lz -lm -ldl -ldl
>
> (yes I aslo tried to remove the -L/home/stefano/lib option):
>
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_comment'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_num_channels'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecSetConfiguration'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_YUVin'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecClose'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncGetCurrentConfiguration'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecGetCurrentConfiguration'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_header'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_block_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_comment_clear'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_wrote'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_comment_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_info_clear'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_comment_add_tag'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_headerout'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_encode_buffer'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncEncode'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecGetErrorMessage'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_close'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_info_clear'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_dsp_clear'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_VBR'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncGetDecoderSpecificInfo'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_setup_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncClose'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_bitrate_flushpacket'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_out_samplerate'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_packetout'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_brate'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_block_clear'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_setup_managed'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_get_framesize'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_encode_flush'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_ctl'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_encode_setup_vbr'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_quality'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_info_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_clear'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_bitrate_addblock'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecOpen'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecDecode'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecInit'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_blockout'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_init_params'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_bWriteVbrTag'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncSetConfiguration'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_tables'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `faacEncOpen'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_comment_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_encode_buffer_interleaved'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_mode'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_analysis_buffer'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_in_samplerate'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_set_VBR_q'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_info_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `lame_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_init'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `NeAACDecInit2'
> /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `vorbis_comment_clear'
> collect2: ld returned 1 exit status
> make: *** [ffmpeg_g] Error 1
[...]

Well, after some investigation:

This is a test program (dlopen-test.c):

#include <dlfcn.h>
#include <stdio.h>

int main(int ac, char ** av)
{
    void *p;
    int i;

    /* order matters!! */
    char *avlibs[]= {
        "libavutil/libavutil.so",
        "libavcodec/libavcodec.so",
        "libavformat/libavformat.so"
    };

    for (i=0; i < sizeof (avlibs) / sizeof(char*); i++) {
        p= dlopen(avlibs[i], RTLD_NOW);
        if (!p) {
            printf("%s\n", dlerror());
            return 1;
        } else {
            printf("%s loaded successfully\n", avlibs[i]);
        }
    }

    printf("All OK\n");
    return 0;
}

to be compiled with gcc dlopen-test.c -o dlopen-test -ldl

stefano@geppetto ~/s/ffmpeg> dlopen-test
libavutil/libavutil.so loaded successfully
libavcodec/libavcodec.so loaded successfully
libavformat/libavformat.so: undefined symbol: av_init_random

av_init_random is defined in libavutil, so I have:
stefano@geppetto ~/s/ffmpeg> nm libavutil/libavutil.so | grep av_init_random
000062a4 T av_init_random

I expect the av_init_random to be loaded when the libavutil.so is
loaded by dlopen().

stefano@geppetto ~/s/ffmpeg> nm libavformat/libavformat.so | grep "av_init_random"
         U av_init_random

Any hint?

Thanks in advance.
--
ffmpeg-user random tip #3
Some few multimedia formats (mpeg-1, mpeg-2:PS, DV) support physical merge
consistency, which means you can merge two files with cat. E.g.:
cat input1.mpeg input2.mpeg > output.mpeg
See: http://ffmpeg.mplayerhq.hu/faq.html#SEC25
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem when building with --enable-shared in Linux

Stefano Sabatini
On date Friday 2007-12-28 16:29:48 +0100, Stefano Sabatini encoded:

> On date Thursday 2007-12-27 11:01:59 +0100, Stefano Sabatini encoded:
> > Hi all,
> >
> > I'm configuring with:
> > configure --prefix=$HOME --enable-shared
> >
> > and no other options.
> >
> > The when linking ffmpeg_g I get:
> >
> > gcc -L"/home/stefano/src/ffmpeg"/libavdevice
> > -L"/home/stefano/src/ffmpeg"/libavformat
> > -L"/home/stefano/src/ffmpeg"/libavcodec
> > -L"/home/stefano/src/ffmpeg"/libavutil -L/home/stefano/lib -rdynamic
> > -export-dynamic -Wl,--warn-common -Wl,--as-needed
> > -Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavcodec
> > -Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavformat
> > -Wl,-rpath-link,"/home/stefano/src/ffmpeg"/libavutil -Wl,-Bsymbolic -g
> > -o ffmpeg_g ffmpeg.o cmdutils.o -lavdevice -lavformat -lavcodec
> > -lavutil -lz -lm -ldl -ldl
> >
> > (yes I aslo tried to remove the -L/home/stefano/lib option):
> >
> > /home/stefano/src/ffmpeg/libavformat/libavformat.so: undefined reference to `theora_encode_comment'
[...]

For the archive, the problem resulted in a Makefile modified in a
remote time, simply reverting the file fixed the issue.

Regards.
--
ffmpeg-user random tip #1
the -b (bitrate) and -ab (audio bitrate) ffmpeg options take as argument a
bitrate expressed in bits per second, and not in Kbits per second as in previous
versions. Change your command lines accordingly.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user