Closed ghost closed 9 years ago
Can you provide the commands that you used for compiling? Also, your platform?
I am using Linux ubuntu 14.04. Command : gcc vorbis-master/examples/encoder_example.c
Please read the README file for building instructions.
Also, note that Ubuntu 14.04 includes Vorbis. You may want to use the distribution package.
After reading README file, I even setup up the svn repository and compiled the encoder_example.c code. Whether it is right to compile encoder_example.c independently or any dependencies should be included?
I want to know how encoder_example works?
My work is to write a 16-bit PCM data buffer to a ogg file.
Please follow the directions in the README:
./autogen.sh
make
Then switch to the examples directory, and type make to compile all of the examples.
By the way, you may want to use libvorbisfile, as it has a much easier API than libvorbis. See the vorbisfile_example.c file.
I am getting the below error when executing command make in the example directory.
$ make
/bin/bash ../libtool --tag=CC --mode=link gcc -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H -o decoder_example decoder_example.o ../lib/libvorbis.la
libtool: link: gcc -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H -o .libs/decoder_example decoder_example.o ../lib/.libs/libvorbis.so
/usr/bin/ld: decoder_example.o: undefined reference to symbol 'ogg_stream_packetout'
//usr/local/lib/libogg.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *\ [decoder_example] Error 1
Something is wrong with your libogg installation. Did you install it from source?
On ubuntu, you can install libogg with sudo apt-get install libogg libogg-devel
No. I installed libogg0 and libogg-dev packages. But still the problem persist.
After you install libogg-dev
you will need to run the ./confgiure
script again.
yeah. I tried to run ./configure again but still I am facing with the error.
I did the following steps, but still the problem persists.
1) checkout on a separate repo. svn checkout https://svn.xiph.org/trunk/vorbis/ ~/vorbis_svn 2) ./configure 3) ./autogen.sh 4) make 5) sudo make install 6) cd examples/ 7) make
At step 7, I am getting the below error.
/bin/bash ../libtool --tag=CC --mode=link gcc -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H -o decoder_example decoder_example.o ../lib/libvorbis.la
libtool: link: gcc -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H -o .libs/decoder_example decoder_example.o ../lib/.libs/libvorbis.so
/usr/bin/ld: decoder_example.o: undefined reference to symbol 'ogg_stream_packetout'
//usr/local/lib/libogg.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *\ [decoder_example] Error 1
Please help me in getting this work done.
Okay, so the problem is t hat the build system is not linking in libogg when it should. -logg should have been automatically put on the command line, here's mine:
libtool: link: gcc -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H -o .libs/decoder_example decoder_example.o ../lib/.libs/libvorbis.so -lm -logg -Wl,-rpath -Wl,/usr/local/lib
I cannot figure out how the -logg is being added in my Makefile. I don't know how this ever worked at all. Maybe an autotools wizard can help.
Ah, I forgot that -logg is added automatically by libtool.
Can you paste your config.log from the root vorbis directory?
This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake.
It was created by libvorbis configure 1.3.5, which was generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --enable-maintainer-mode
hostname = arunbalaji-VPCEA33EN uname -m = x86_64 uname -r = 3.16.0-30-generic uname -s = Linux uname -v = #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015
/usr/bin/uname -p = unknown /bin/uname -X = unknown
/bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown
PATH: /home/arunbalaji/Downloads/google_appengine/google/yes/google-cloud-sdk/bin PATH: /usr/local/sbin PATH: /usr/local/bin PATH: /usr/sbin PATH: /usr/bin PATH: /sbin PATH: /bin PATH: /usr/games PATH: /usr/local/games
configure:2357: checking build system type configure:2371: result: x86_64-unknown-linux-gnu configure:2391: checking host system type configure:2404: result: x86_64-unknown-linux-gnu configure:2424: checking target system type configure:2437: result: x86_64-unknown-linux-gnu configure:2480: checking for a BSD-compatible install configure:2548: result: /usr/bin/install -c configure:2559: checking whether build environment is sane configure:2614: result: yes configure:2765: checking for a thread-safe mkdir -p configure:2804: result: /bin/mkdir -p configure:2811: checking for gawk configure:2841: result: no configure:2811: checking for mawk configure:2827: found /usr/bin/mawk configure:2838: result: mawk configure:2849: checking whether make sets $(MAKE) configure:2871: result: yes configure:2900: checking whether make supports nested variables configure:2917: result: yes configure:3043: checking whether to enable maintainer-specific portions of Makefiles configure:3052: result: yes configure:3142: checking for gcc configure:3158: found /usr/bin/gcc configure:3169: result: gcc configure:3398: checking for C compiler version configure:3407: gcc --version >&5 gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3418: $? = 0 configure:3407: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) configure:3418: $? = 0 configure:3407: gcc -V >&5 gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:3418: $? = 4 configure:3407: gcc -qversion >&5 gcc: error: unrecognized command line option '-qversion' gcc: fatal error: no input files compilation terminated. configure:3418: $? = 4 configure:3438: checking whether the C compiler works configure:3460: gcc conftest.c >&5 configure:3464: $? = 0 configure:3512: result: yes configure:3515: checking for C compiler default output file name configure:3517: result: a.out configure:3523: checking for suffix of executables configure:3530: gcc -o conftest conftest.c >&5 configure:3534: $? = 0 configure:3556: result: configure:3578: checking whether we are cross compiling configure:3586: gcc -o conftest conftest.c >&5 configure:3590: $? = 0 configure:3597: ./conftest configure:3601: $? = 0 configure:3616: result: no configure:3621: checking for suffix of object files configure:3643: gcc -c conftest.c >&5 configure:3647: $? = 0 configure:3668: result: o configure:3672: checking whether we are using the GNU C compiler configure:3691: gcc -c conftest.c >&5 configure:3691: $? = 0 configure:3700: result: yes configure:3709: checking whether gcc accepts -g configure:3729: gcc -c -g conftest.c >&5 configure:3729: $? = 0 configure:3770: result: yes configure:3787: checking for gcc option to accept ISO C89 configure:3850: gcc -c -g -O2 conftest.c >&5 configure:3850: $? = 0 configure:3863: result: none needed configure:3888: checking whether gcc understands -c and -o together configure:3910: gcc -c conftest.c -o conftest2.o configure:3913: $? = 0 configure:3910: gcc -c conftest.c -o conftest2.o configure:3913: $? = 0 configure:3925: result: yes configure:3953: checking for style of include used by make configure:3981: result: GNU configure:4007: checking dependency style of gcc configure:4118: result: gcc3 configure:4138: checking how to run the C preprocessor configure:4169: gcc -E conftest.c configure:4169: $? = 0 configure:4183: gcc -E conftest.c conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory
^
compilation terminated.
configure:4183: $? = 1
configure: failed program was:
| /* confdefs.h _/
| #define PACKAGE_NAME "libvorbis"
| #define PACKAGE_TARNAME "libvorbis"
| #define PACKAGE_VERSION "1.3.5"
| #define PACKAGE_STRING "libvorbis 1.3.5"
| #define PACKAGE_BUGREPORT "vorbis-dev@xiph.org"
| #define PACKAGEURL ""
| #define PACKAGE "libvorbis"
| #define VERSION "1.3.5"
| / end confdefs.h. _/
| #include
^
compilation terminated.
configure:4242: $? = 1
configure: failed program was:
| / confdefs.h /
| #define PACKAGE_NAME "libvorbis"
| #define PACKAGE_TARNAME "libvorbis"
| #define PACKAGE_VERSION "1.3.5"
| #define PACKAGE_STRING "libvorbis 1.3.5"
| #define PACKAGE_BUGREPORT "vorbis-dev@xiph.org"
| #define PACKAGEURL ""
| #define PACKAGE "libvorbis"
| #define VERSION "1.3.5"
| / end confdefs.h. _/
| #include
This file was extended by libvorbis config.status 1.3.5, which was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = CONFIG_HEADERS = CONFIG_LINKS = CONFIG_COMMANDS = $ ./config.status
on arunbalaji-VPCEA33EN
config.status:1143: creating Makefile config.status:1143: creating m4/Makefile config.status:1143: creating lib/Makefile config.status:1143: creating lib/modes/Makefile config.status:1143: creating lib/books/Makefile config.status:1143: creating lib/books/coupled/Makefile config.status:1143: creating lib/books/uncoupled/Makefile config.status:1143: creating lib/books/floor/Makefile config.status:1143: creating doc/Makefile config.status:1143: creating doc/vorbisfile/Makefile config.status:1143: creating doc/vorbisenc/Makefile config.status:1143: creating doc/libvorbis/Makefile config.status:1143: creating doc/Doxyfile config.status:1143: creating include/Makefile config.status:1143: creating include/vorbis/Makefile config.status:1143: creating examples/Makefile config.status:1143: creating test/Makefile config.status:1143: creating vq/Makefile config.status:1143: creating libvorbis.spec config.status:1143: creating vorbis.pc config.status:1143: creating vorbisenc.pc config.status:1143: creating vorbisfile.pc config.status:1143: creating vorbis-uninstalled.pc config.status:1143: creating vorbisenc-uninstalled.pc config.status:1143: creating vorbisfile-uninstalled.pc config.status:1143: creating config.h config.status:1324: config.h is unchanged config.status:1372: executing depfiles commands config.status:1372: executing libtool commands
ac_cv_build=x86_64-unknown-linux-gnu ac_cv_c_compiler_gnu=yes ac_cv_c_inline=inline ac_cv_env_CC_set= ac_cv_env_CC_value= ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_OGG_CFLAGS_set= ac_cv_env_OGG_CFLAGS_value= ac_cv_env_OGG_LIBS_set= ac_cv_env_OGG_LIBS_value= ac_cv_env_PKG_CONFIG_set= ac_cv_env_PKG_CONFIG_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_func_alloca_works=yes ac_cv_func_memcmp_working=yes ac_cv_header_dlfcn_h=yes ac_cv_header_inttypes_h=yes ac_cv_header_memory_h=yes ac_cv_header_stdc=yes ac_cv_header_stdint_h=yes ac_cv_header_stdlib_h=yes ac_cv_header_string_h=yes ac_cv_header_strings_h=yes ac_cv_header_sys_stat_h=yes ac_cv_header_sys_types_h=yes ac_cv_header_unistd_h=yes ac_cv_host=x86_64-unknown-linux-gnu ac_cv_lib_m_cos=yes ac_cv_lib_pthread_pthread_create=yes ac_cv_objext=o ac_cv_path_EGREP='/bin/grep -E' ac_cv_path_FGREP='/bin/grep -F' ac_cv_path_GREP=/bin/grep ac_cv_path_SED=/bin/sed ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config ac_cv_path_install='/usr/bin/install -c' ac_cv_path_mkdir=/bin/mkdir ac_cv_prog_AWK=mawk ac_cv_prog_CPP='gcc -E' ac_cv_prog_ac_ct_AR=ar ac_cv_prog_ac_ct_CC=gcc ac_cv_prog_ac_ct_DLLTOOL=dlltool ac_cv_prog_ac_ct_MANIFEST_TOOL=mt ac_cv_prog_ac_ct_OBJDUMP=objdump ac_cv_prog_ac_ct_RANLIB=ranlib ac_cv_prog_ac_ct_STRIP=strip ac_cv_prog_cc_c89= ac_cv_prog_cc_g=yes ac_cv_prog_make_make_set=yes ac_cv_target=x86_64-unknown-linux-gnu ac_cv_type_size_t=yes ac_cv_working_alloca_h=yes am_cv_CC_dependencies_compiler_type=gcc3 am_cv_make_support_nested_variables=yes am_cv_prog_cc_c_o=yes lt_cv_ar_at_file=@ lt_cv_archive_cmds_need_lc=no lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_ld_reload_flag=-r lt_cv_nm_interface='BSD nm' lt_cv_objdir=.libs lt_cv_path_LD=/usr/bin/ld lt_cv_path_NM='/usr/bin/nm -B' lt_cv_path_mainfest_tool=no lt_cv_prog_compiler_c_o=yes lt_cv_prog_compiler_pic='-fPIC -DPIC' lt_cv_prog_compiler_pic_works=yes lt_cv_prog_compiler_rtti_exceptions=no lt_cv_prog_compiler_static_works=yes lt_cv_prog_gnu_ld=yes lt_cv_sharedlib_from_linklib_cmd='printf %s\n' lt_cv_shlibpath_overrides_runpath=no lt_cv_sys_global_symbolpipe='sed -n -e '\''s/^. [ ][ ]_([_A-Za-z][A-Za-z0-9])$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' lt_cv_sys_global_symbol_to_c_nameaddress='sed -n -e '\''s/^: ([^ ])[ ]$/ {\"\1\", (void ) 0},/p'\'' -e '\''s/^[ABCDGIRSTW] ([^ ]) ([^ ])$/ {"\2", (void ) &\2},/p'\''' lt_cv_sys_global_symbol_to_c_name_address_libprefix='sed -n -e '\''s/^: ([^ ])[ ]$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW] ([^ ]) (lib[^ ])$/ {"\2", (void ) &\2},/p'\'' -e '\''s/^[ABCDGIRSTW] ([^ ]) ([^ ])$/ {"lib\2", (void _) &\2},/p'\''' lt_cv_sys_global_symbol_tocdecl='sed -n -e '\''s/^T . (.)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW] .* (.*)$/extern char \1;/p'\''' lt_cv_sys_max_cmd_len=1572864 lt_cv_to_host_file_cmd=func_convert_file_noop lt_cv_to_tool_file_cmd=func_convert_file_noop pkg_cv_OGG_CFLAGS='-I/usr/local/include ' pkg_cv_OGG_LIBS='-L/usr/local/lib -logg '
ACLOCAL='${SHELL} /home/arunbalaji/vorbis_svn/missing aclocal-1.14' ACLOCAL_AMFLAGS='-I m4' ALLOCA='' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AM_BACKSLASH='\' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' AM_DEFAULT_VERBOSITY='1' AM_V='$(V)' AR='ar' AS='as' AUTOCONF='${SHELL} /home/arunbalaji/vorbis_svn/missing autoconf' AUTOHEADER='${SHELL} /home/arunbalaji/vorbis_svn/missing autoheader' AUTOMAKE='${SHELL} /home/arunbalaji/vorbis_svn/missing automake-1.14' AWK='mawk' BUILD_DOCS_FALSE='' BUILD_DOCS_TRUE='#' BUILD_EXAMPLES_FALSE='' BUILD_EXAMPLES_TRUE='#' CC='gcc' CCDEPMODE='depmode=gcc3' CFLAGS='-O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H' CPP='gcc -E' CPPFLAGS='' CYGPATH_W='echo' DEBUG='-g -Wall -Wextra -D_REENTRANT -DNO_MATH_INLINES -fsigned-char' DEFS='-DHAVE_CONFIG_H' DEPDIR='.deps' DLLTOOL='dlltool' DSYMUTIL='' DUMPBIN='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='/bin/grep -E' EXEEXT='' FGREP='/bin/grep -F' GREP='/bin/grep' HAVE_DOXYGEN='false' HAVE_DOXYGEN_FALSE='' HAVE_DOXYGEN_TRUE='#' HTLATEX='' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LD='/usr/bin/ld -m elf_x86_64' LDFLAGS='' LIBOBJS='' LIBS='' LIBTOOL='$(SHELL) $(top_builddir)/libtool' LIBTOOL_DEPS='./ltmain.sh' LIPO='' LN_S='ln -s' LTLIBOBJS='' MAINT='' MAINTAINER_MODE_FALSE='#' MAINTAINER_MODE_TRUE='' MAKEINFO='${SHELL} /home/arunbalaji/vorbis_svn/missing makeinfo' MANIFEST_TOOL=':' MKDIR_P='/bin/mkdir -p' NM='/usr/bin/nm -B' NMEDIT='' OBJDUMP='objdump' OBJEXT='o' OGG_CFLAGS='-I/usr/local/include ' OGG_LIBS='-L/usr/local/lib -logg ' OTOOL64='' OTOOL='' PACKAGE='libvorbis' PACKAGE_BUGREPORT='vorbis-dev@xiph.org' PACKAGE_NAME='libvorbis' PACKAGE_STRING='libvorbis 1.3.5' PACKAGE_TARNAME='libvorbis' PACKAGE_URL='' PACKAGE_VERSION='1.3.5' PATH_SEPARATOR=':' PDFLATEX='' PKG_CONFIG='/usr/bin/pkg-config' PROFILE='-pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char' RANLIB='ranlib' SED='/bin/sed' SET_MAKE='' SHELL='/bin/bash' STRIP='strip' VERSION='1.3.5' VE_LIB_AGE='0' VE_LIB_CURRENT='2' VE_LIB_REVISION='11' VF_LIB_AGE='3' VF_LIB_CURRENT='6' VF_LIB_REVISION='7' VORBIS_LIBS='-lm' V_LIB_AGE='4' V_LIB_CURRENT='4' V_LIB_REVISION='8' ac_ct_AR='ar' ac_ct_CC='gcc' ac_ct_DUMPBIN='' am__EXEEXT_FALSE='' amEXEEXT_TRUE='#' amfastdepCC_FALSE='#' am__fastdepCC_TRUE='' aminclude='include' amisrc='' amleading_dot='.' am__nodep='_no' amquote='' amtar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' bindir='${exec_prefix}/bin' build='x86_64-unknown-linux-gnu' build_alias='' build_cpu='x86_64' build_os='linux-gnu' build_vendor='unknown' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='${prefix}' host='x86_64-unknown-linux-gnu' host_alias='' host_cpu='x86_64' host_os='linux-gnu' host_vendor='unknown' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /home/arunbalaji/vorbis_svn/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' mkdir_p='$(MKDIR_P)' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='/usr/local' program_transform_name='s,x,x,' psdir='${docdir}' pthread_lib='-lpthread' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target='x86_64-unknown-linux-gnu' target_alias='' target_cpu='x86_64' target_os='linux-gnu' target_vendor='unknown'
/* confdefs.h */
configure: exit 0
Can you test this patch and see if it solves your problem? You will need to run ./autogen.sh and ./configure again.
I tried testing the patch but it never solves the problem.
@arun09e902 tdaede's fix should have resolved your issue. Can you try:
git clone https://git.xiph.org/vorbis.git
cd vorbis
./autogen.sh
./configure
make
cd examples
make
Closing presumed fixed. Please re-open if you're still having this issue.
Did this ever get resolved 5 yrs ago? I'm having the same problem, and can't seem to find a solution. Same Exact Errors.
I started getting this error in Debian for a software that used to build, without changing the software (but libvorbis probably was upgraded):
Ah, -lvorbis
was missing due to missing pkg-config
.
That would explain it. Glad you figured it out!
You need both -lvorbis
and -lvorbisenc
. The full flags needed are something like:
clang -o encode -lvorbis -lvorbisenc -logg encoder_example.c
/tmp/ccFY2ZX4.o: In function
main': encoder_example.c:(.text+0xe7): undefined reference to
vorbis_info_init' encoder_example.c:(.text+0x108): undefined reference tovorbis_encode_init_vbr' encoder_example.c:(.text+0x130): undefined reference to
vorbis_comment_init' encoder_example.c:(.text+0x149): undefined reference tovorbis_comment_add_tag' encoder_example.c:(.text+0x162): undefined reference to
vorbis_analysis_init' encoder_example.c:(.text+0x17b): undefined reference tovorbis_block_init' encoder_example.c:(.text+0x1a4): undefined reference to
ogg_stream_init' encoder_example.c:(.text+0x1d2): undefined reference tovorbis_analysis_headerout' encoder_example.c:(.text+0x1eb): undefined reference to
ogg_stream_packetin' encoder_example.c:(.text+0x204): undefined reference toogg_stream_packetin' encoder_example.c:(.text+0x21d): undefined reference to
ogg_stream_packetin' encoder_example.c:(.text+0x238): undefined reference toogg_stream_flush' encoder_example.c:(.text+0x2e4): undefined reference to
vorbis_analysis_wrote' encoder_example.c:(.text+0x2fd): undefined reference tovorbis_analysis_buffer' encoder_example.c:(.text+0x429): undefined reference to
vorbis_analysis_wrote' encoder_example.c:(.text+0x442): undefined reference tovorbis_analysis' encoder_example.c:(.text+0x451): undefined reference to
vorbis_bitrate_addblock' encoder_example.c:(.text+0x46f): undefined reference toogg_stream_packetin' encoder_example.c:(.text+0x48d): undefined reference to
ogg_stream_pageout' encoder_example.c:(.text+0x4f7): undefined reference toogg_page_eos' encoder_example.c:(.text+0x52b): undefined reference to
vorbis_bitrate_flushpacket' encoder_example.c:(.text+0x54c): undefined reference tovorbis_analysis_blockout' encoder_example.c:(.text+0x571): undefined reference to
ogg_stream_clear' encoder_example.c:(.text+0x580): undefined reference tovorbis_block_clear' encoder_example.c:(.text+0x58f): undefined reference to
vorbis_dsp_clear' encoder_example.c:(.text+0x59e): undefined reference tovorbis_comment_clear' encoder_example.c:(.text+0x5ad): undefined reference to
vorbis_info_clear' collect2: error: ld returned 1 exit status