Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7213 closed defect (invalid)

Cannot build ffmpeg 4.0 with --enable-libvorbis

Reported by: Mario Grgic Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I am trying to build ffmpeg 4.0 with Xcode 9.3 on macOS 10.13.4. I have installed latest libvorbis with its dependencies.

I have configured ffmpeg as follows:

./configure --prefix=/Volumes/ramdisk/ffmpeg --as=yasm --extra-version=Wu --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-version3 --enable-runtime-cpudetect --enable-libvo-amrwbenc --enable-opengl --enable-opencl --datadir=/usr/local/share/ffmpeg --mandir=/usr/local/share/man

and got the error:

ERROR: vorbis not found using pkg-config

The config.log shows:

gcc -L/Volumes/ramdisk/ffmpeg/lib -Wl,-dynamic,-search_paths_first -o /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test.o -lvo-amrwbenc
require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init
check_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init
test_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init
pkg-config --exists --print-errors vorbis
check_func_headers vorbis/codec.h vorbis_info_init -I/Volumes/ramdisk/ffmpeg/include -L/Volumes/ramdisk/ffmpeg/lib -lvorbis
test_ld cc -I/Volumes/ramdisk/ffmpeg/include -L/Volumes/ramdisk/ffmpeg/lib -lvorbis
test_cc -I/Volumes/ramdisk/ffmpeg/include -L/Volumes/ramdisk/ffmpeg/lib
BEGIN /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test.c

1 #include <vorbis/codec.h>
2 #include <stdint.h>
3 long check_vorbis_info_init(void) { return (long) vorbis_info_init; }
4 int main(void) { int ret = 0;
5 ret |= ((intptr_t)check_vorbis_info_init) & 0xFFFF;
6 return ret; }

END /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I$(SRC_PATH)/compat/dispatch_semaphore -DPIC -I/Volumes/ramdisk/ffmpeg/include -L/Volumes/ramdisk/ffmpeg/lib -std=c11 -Werror=partial-availability -fomit-frame-pointer -fPIC -pthread -I/Volumes/ramdisk/include -I/Volumes/ramdisk/ffmpeg/include -L/Volumes/ramdisk/ffmpeg/lib -c -o /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/T
ffconf.p6ZBvzlB/test.o /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test.c
clang: warning: argument unused during compilation: '-L/Volumes/ramdisk/ffmpeg/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/Volumes/ramdisk/ffmpeg/lib' [-Wunused-command-line-argument]
gcc -L/Volumes/ramdisk/ffmpeg/lib -Wl,-dynamic,-search_paths_first -I/Volumes/ramdisk/ffmpeg/include -L/Volumes/ramdisk/ffmpeg/lib -o /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/T
ffconf.p6ZBvzlB/test /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test.o -lvorbis
Undefined symbols for architecture x86_64:

"_oggpack_adv", referenced from:

_decode_packed_entry_number in libvorbis.a(codebook.o)

"_oggpack_bytes", referenced from:

_vorbis_synthesis_headerin in libvorbis.a(info.o)
_vorbis_commentheader_out in libvorbis.a(info.o)
_vorbis_analysis_headerout in libvorbis.a(info.o)
_vorbis_staticbook_unpack in libvorbis.a(codebook.o)
_vorbis_bitrate_addblock in libvorbis.a(bitrate.o)
_vorbis_bitrate_flushpacket in libvorbis.a(bitrate.o)

"_oggpack_get_buffer", referenced from:

_vorbis_bitrate_flushpacket in libvorbis.a(bitrate.o)

"_oggpack_look", referenced from:

_decode_packed_entry_number in libvorbis.a(codebook.o)

"_oggpack_read", referenced from:

_vorbis_synthesis_idheader in libvorbis.a(info.o)
_vorbis_synthesis_headerin in libvorbis.a(info.o)
_vorbis_staticbook_unpack in libvorbis.a(codebook.o)
_floor0_unpack in libvorbis.a(floor0.o)
_floor0_inverse1 in libvorbis.a(floor0.o)
_floor1_unpack in libvorbis.a(floor1.o)
_floor1_inverse1 in libvorbis.a(floor1.o)
...

"_oggpack_readinit", referenced from:

_vorbis_synthesis_idheader in libvorbis.a(info.o)
_vorbis_synthesis_headerin in libvorbis.a(info.o)

"_oggpack_reset", referenced from:

_vorbis_analysis_headerout in libvorbis.a(info.o)

"_oggpack_write", referenced from:

vorbis_pack_comment in libvorbis.a(info.o)
_vorbis_analysis_headerout in libvorbis.a(info.o)
_vorbis_staticbook_pack in libvorbis.a(codebook.o)
_vorbis_book_encode in libvorbis.a(codebook.o)
_floor1_encode in libvorbis.a(floor1.o)
_floor1_pack in libvorbis.a(floor1.o)
_mapping0_pack in libvorbis.a(mapping0.o)
...

"_oggpack_writeclear", referenced from:

_vorbis_commentheader_out in libvorbis.a(info.o)
_vorbis_analysis_headerout in libvorbis.a(info.o)
_vorbis_block_clear in libvorbis.a(block.o)

"_oggpack_writeinit", referenced from:

_vorbis_commentheader_out in libvorbis.a(info.o)
_vorbis_analysis_headerout in libvorbis.a(info.o)
_vorbis_block_init in libvorbis.a(block.o)

"_oggpack_writetrunc", referenced from:

_vorbis_bitrate_addblock in libvorbis.a(bitrate.o)

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: vorbis not found using pkg-config

Entire config log attached.

Attachments (1)

config.log (470.9 KB ) - added by Mario Grgic 6 years ago.

Download all attachments as: .zip

Change History (5)

by Mario Grgic, 6 years ago

Attachment: config.log added

comment:1 by Mario Grgic, 6 years ago

If I also add -logg option to the linker command:

gcc -L/Volumes/ramdisk/ffmpeg/lib -Wl,-dynamic,-search_paths_first -I/Volumes/ramdisk/ffmpeg/include -L/Volumes/ramdisk/ffmpeg/lib -o /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test /var/folders/rk/7t49495d3w1btf_fydzx6k200000gn/Tffconf.p6ZBvzlB/test.o -lvorbis -logg

then it all works. I have compiled vorbis with ogg support, and it seems it now needs to have ogg library added as dependency. I have worked around this problem by modifying vorbis.pc file in pkgconfig path to also have -logg in library search path.

comment:2 by Timo R., 6 years ago

That means its pkg-config file is broken then. It's supposed to provide such informations.

comment:3 by James, 6 years ago

Resolution: invalid
Status: newclosed

This is not an ffmpeg issue. It looks like you only have static libraries of libvorbis and libogg in your system, so you need to run ffmpeg's configure with --pkg-config-flags="--static" in order to get pkg-config to explicitly include all of libvorbis dependencies (That means libogg).

Last edited 6 years ago by James (previous) (diff)

in reply to:  3 comment:4 by Mario Grgic, 6 years ago

Replying to jamrial:

This is not an ffmpeg issue. It looks like you only have static libraries of libvorbis and libogg in your system, so you need to run ffmpeg's configure with --pkg-config-flags="--static" in order to get pkg-config to explicitly include all of libvorbis dependencies (That means libogg).

Thank you. That solves my problem. And yes, I am building static ffmpeg with all dependencies (i.e. all third party libraries built statically as well) for maximal portability.

Note: See TracTickets for help on using tickets.