xiph / vorbis

Reference implementation of the Ogg Vorbis audio format.
BSD 3-Clause "New" or "Revised" License
463 stars 187 forks source link

compilation error in gcc vorbis-master/examples/encoder_example.c #1

Closed ghost closed 9 years ago

ghost commented 9 years ago

/tmp/ccFY2ZX4.o: In function main': encoder_example.c:(.text+0xe7): undefined reference tovorbis_info_init' encoder_example.c:(.text+0x108): undefined reference to vorbis_encode_init_vbr' encoder_example.c:(.text+0x130): undefined reference tovorbis_comment_init' encoder_example.c:(.text+0x149): undefined reference to vorbis_comment_add_tag' encoder_example.c:(.text+0x162): undefined reference tovorbis_analysis_init' encoder_example.c:(.text+0x17b): undefined reference to vorbis_block_init' encoder_example.c:(.text+0x1a4): undefined reference toogg_stream_init' encoder_example.c:(.text+0x1d2): undefined reference to vorbis_analysis_headerout' encoder_example.c:(.text+0x1eb): undefined reference toogg_stream_packetin' encoder_example.c:(.text+0x204): undefined reference to ogg_stream_packetin' encoder_example.c:(.text+0x21d): undefined reference toogg_stream_packetin' encoder_example.c:(.text+0x238): undefined reference to ogg_stream_flush' encoder_example.c:(.text+0x2e4): undefined reference tovorbis_analysis_wrote' encoder_example.c:(.text+0x2fd): undefined reference to vorbis_analysis_buffer' encoder_example.c:(.text+0x429): undefined reference tovorbis_analysis_wrote' encoder_example.c:(.text+0x442): undefined reference to vorbis_analysis' encoder_example.c:(.text+0x451): undefined reference tovorbis_bitrate_addblock' encoder_example.c:(.text+0x46f): undefined reference to ogg_stream_packetin' encoder_example.c:(.text+0x48d): undefined reference toogg_stream_pageout' encoder_example.c:(.text+0x4f7): undefined reference to ogg_page_eos' encoder_example.c:(.text+0x52b): undefined reference tovorbis_bitrate_flushpacket' encoder_example.c:(.text+0x54c): undefined reference to vorbis_analysis_blockout' encoder_example.c:(.text+0x571): undefined reference toogg_stream_clear' encoder_example.c:(.text+0x580): undefined reference to vorbis_block_clear' encoder_example.c:(.text+0x58f): undefined reference tovorbis_dsp_clear' encoder_example.c:(.text+0x59e): undefined reference to vorbis_comment_clear' encoder_example.c:(.text+0x5ad): undefined reference tovorbis_info_clear' collect2: error: ld returned 1 exit status

tdaede commented 9 years ago

Can you provide the commands that you used for compiling? Also, your platform?

ghost commented 9 years ago

I am using Linux ubuntu 14.04. Command : gcc vorbis-master/examples/encoder_example.c

tdaede commented 9 years ago

Please read the README file for building instructions.

Also, note that Ubuntu 14.04 includes Vorbis. You may want to use the distribution package.

ghost commented 9 years ago

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?

ghost commented 9 years ago

I want to know how encoder_example works?

My work is to write a 16-bit PCM data buffer to a ogg file.

tdaede commented 9 years ago

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.

ghost commented 9 years ago

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

tdaede commented 9 years ago

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

ghost commented 9 years ago

No. I installed libogg0 and libogg-dev packages. But still the problem persist.

erikd commented 9 years ago

After you install libogg-dev you will need to run the ./confgiure script again.

ghost commented 9 years ago

yeah. I tried to run ./configure again but still I am facing with the error.

ghost commented 9 years ago

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.

tdaede commented 9 years ago

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.

tdaede commented 9 years ago

Ah, I forgot that -logg is added automatically by libtool.

Can you paste your config.log from the root vorbis directory?

ghost commented 9 years ago

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

---------

Platform.

---------

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

-----------

Core tests.

-----------

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

include

                        ^

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 configure:4208: result: gcc -E configure:4228: gcc -E conftest.c configure:4228: $? = 0 configure:4242: gcc -E conftest.c conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory

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 configure:4273: checking for inline configure:4289: gcc -c conftest.c >&5 configure:4289: $? = 0 configure:4297: result: inline configure:4665: checking how to print strings configure:4692: result: printf configure:4713: checking for a sed that does not truncate output configure:4777: result: /bin/sed configure:4795: checking for grep that handles long lines and -e configure:4853: result: /bin/grep configure:4858: checking for egrep configure:4920: result: /bin/grep -E configure:4925: checking for fgrep configure:4987: result: /bin/grep -F configure:5022: checking for ld used by gcc configure:5089: result: /usr/bin/ld configure:5096: checking if the linker (/usr/bin/ld) is GNU ld configure:5111: result: yes configure:5123: checking for BSD- or MS-compatible name lister (nm) configure:5172: result: /usr/bin/nm -B configure:5302: checking the name lister (/usr/bin/nm -B) interface configure:5309: gcc -c conftest.c >&5 configure:5312: /usr/bin/nm -B "conftest.o" configure:5315: output 0000000000000000 B some_variable configure:5322: result: BSD nm configure:5325: checking whether ln -s works configure:5329: result: yes configure:5337: checking the maximum length of command line arguments configure:5468: result: 1572864 configure:5485: checking whether the shell understands some XSI constructs configure:5495: result: yes configure:5499: checking whether the shell understands "+=" configure:5505: result: yes configure:5540: checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format configure:5580: result: func_convert_file_noop configure:5587: checking how to convert x86_64-unknown-linux-gnu file names to toolchain format configure:5607: result: func_convert_file_noop configure:5614: checking for /usr/bin/ld option to reload object files configure:5621: result: -r configure:5695: checking for objdump configure:5722: result: objdump configure:5751: checking how to recognize dependent libraries configure:5949: result: passall configure:6034: checking for dlltool configure:6061: result: dlltool configure:6091: checking how to associate runtime and link libraries configure:6118: result: printf %s\n configure:6178: checking for ar configure:6194: found /usr/bin/ar configure:6205: result: ar configure:6242: checking for archiver @FILE support configure:6259: gcc -c conftest.c >&5 configure:6259: $? = 0 configure:6262: ar cru libconftest.a @conftest.lst >&5 configure:6265: $? = 0 configure:6270: ar cru libconftest.a @conftest.lst >&5 ar: conftest.o: No such file or directory configure:6273: $? = 1 configure:6285: result: @ configure:6343: checking for strip configure:6359: found /usr/bin/strip configure:6370: result: strip configure:6442: checking for ranlib configure:6458: found /usr/bin/ranlib configure:6469: result: ranlib configure:6571: checking command to parse /usr/bin/nm -B output from gcc object configure:6691: gcc -c conftest.c >&5 configure:6694: $? = 0 configure:6698: /usr/bin/nm -B conftest.o | sed -n -e 's/^. [ ][ ]_([_A-Za-z][A-Za-z0-9])$/\1 \2 \2/p' | sed '/ __gnu_lto/d' > conftest.nm configure:6701: $? = 0 configure:6767: gcc -o conftest conftest.c conftstm.o >&5 configure:6770: $? = 0 configure:6808: result: ok configure:6845: checking for sysroot configure:6875: result: no configure:6952: gcc -c conftest.c >&5 configure:6955: $? = 0 configure:7144: checking for mt configure:7160: found /bin/mt configure:7171: result: mt configure:7194: checking if mt is a manifest tool configure:7200: mt '-?' configure:7208: result: no configure:7846: checking for ANSI C header files configure:7866: gcc -c conftest.c >&5 configure:7866: $? = 0 configure:7939: gcc -o conftest conftest.c >&5 configure:7939: $? = 0 configure:7939: ./conftest configure:7939: $? = 0 configure:7950: result: yes configure:7963: checking for sys/types.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for sys/stat.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for stdlib.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for string.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for memory.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for strings.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for inttypes.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for stdint.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7963: checking for unistd.h configure:7963: gcc -c conftest.c >&5 configure:7963: $? = 0 configure:7963: result: yes configure:7977: checking for dlfcn.h configure:7977: gcc -c conftest.c >&5 configure:7977: $? = 0 configure:7977: result: yes configure:8181: checking for objdir configure:8196: result: .libs configure:8463: checking if gcc supports -fno-rtti -fno-exceptions configure:8481: gcc -c -fno-rtti -fno-exceptions conftest.c >&5 cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C [enabled by default] configure:8485: $? = 0 configure:8498: result: no configure:8825: checking for gcc option to produce PIC configure:8832: result: -fPIC -DPIC configure:8840: checking if gcc PIC flag -fPIC -DPIC works configure:8858: gcc -c -fPIC -DPIC -DPIC conftest.c >&5 configure:8862: $? = 0 configure:8875: result: yes configure:8904: checking if gcc static flag -static works configure:8932: result: yes configure:8947: checking if gcc supports -c -o file.o configure:8968: gcc -c -o out/conftest2.o conftest.c >&5 configure:8972: $? = 0 configure:8994: result: yes configure:9002: checking if gcc supports -c -o file.o configure:9049: result: yes configure:9082: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries configure:10239: result: yes configure:10276: checking whether -lc should be explicitly linked in configure:10284: gcc -c conftest.c >&5 configure:10287: $? = 0 configure:10302: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2>&1 | /bin/grep -lc >/dev/null 2>&1 configure:10305: $? = 0 configure:10319: result: no configure:10479: checking dynamic linker characteristics configure:10979: gcc -o conftest -Wl,-rpath -Wl,/foo conftest.c >&5 configure:10979: $? = 0 configure:11213: result: GNU/Linux ld.so configure:11320: checking how to hardcode library paths into programs configure:11345: result: immediate configure:11885: checking whether stripping libraries is possible configure:11890: result: yes configure:11925: checking if libtool supports shared libraries configure:11927: result: yes configure:11930: checking whether to build shared libraries configure:11951: result: yes configure:11954: checking whether to build static libraries configure:11958: result: yes configure:12199: checking GCC version configure:12202: result: 4.8 configure:12343: checking if gcc accepts -Wdeclaration-after-statement configure:12358: gcc -o conftest -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement conftest.c >&5 configure:12358: $? = 0 configure:12359: result: yes configure:12373: checking for memory.h configure:12373: result: yes configure:12385: checking for cos in -lm configure:12410: gcc -o conftest -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H conftest.c -lm >&5 conftest.c:30:6: warning: conflicting types for built-in function 'cos' [enabled by default] char cos (); ^ configure:12410: $? = 0 configure:12419: result: yes configure:12427: checking for pthread_create in -lpthread configure:12452: gcc -o conftest -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H conftest.c -lpthread >&5 configure:12452: $? = 0 configure:12461: result: yes configure:12519: checking for pkg-config configure:12537: found /usr/bin/pkg-config configure:12549: result: /usr/bin/pkg-config configure:12574: checking pkg-config is at least version 0.9.0 configure:12577: result: yes configure:12592: checking for OGG configure:12600: $PKG_CONFIG --exists --print-errors "ogg >= 1.0" configure:12603: $? = 0 configure:12618: $PKG_CONFIG --exists --print-errors "ogg >= 1.0" configure:12621: $? = 0 configure:12657: result: yes configure:12840: checking for size_t configure:12840: gcc -c -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H conftest.c >&5 configure:12840: $? = 0 configure:12840: gcc -c -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H conftest.c >&5 conftest.c: In function 'main': conftest.c:59:21: error: expected expression before ')' token if (sizeof ((sizet))) ^ configure:12840: $? = 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 PACKAGE_URL "" | #define PACKAGE "libvorbis" | #define VERSION "1.3.5" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LTOBJDIR ".libs/" | / end confdefs.h. */ | #include | #ifdef HAVE_SYS_TYPES_H | # include <sys/types.h> | #endif | #ifdef HAVE_SYS_STAT_H | # include <sys/stat.h> | #endif | #ifdef STDC_HEADERS | # include | # include | #else | # ifdef HAVE_STDLIB_H | # include | # endif | #endif | #ifdef HAVE_STRING_H | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H | # include | # endif | # include | #endif | #ifdef HAVE_STRINGS_H | # include | #endif | #ifdef HAVE_INTTYPES_H | # include | #endif | #ifdef HAVE_STDINT_H | # include | #endif | #ifdef HAVE_UNISTD_H | # include | #endif | int | main () | { | if (sizeof ((size_t))) | return 0; | ; | return 0; | } configure:12840: result: yes configure:12853: checking for working alloca.h configure:12870: gcc -o conftest -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H conftest.c >&5 configure:12870: $? = 0 configure:12878: result: yes configure:12886: checking for alloca configure:12923: gcc -o conftest -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H conftest.c >&5 configure:12923: $? = 0 configure:12931: result: yes configure:13037: checking for working memcmp configure:13080: gcc -o conftest -O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char -Wdeclaration-after-statement -DUSE_MEMORY_H conftest.c >&5 configure:13080: $? = 0 configure:13080: ./conftest configure:13080: $? = 0 configure:13090: result: yes configure:13222: checking that generated files are newer than configure configure:13228: result: done configure:13267: creating ./config.status

----------------------

Running config.status.

----------------------

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

----------------

Cache variables.

----------------

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 '

-----------------

Output variables.

-----------------

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.

-----------

/* 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 PACKAGE_URL ""

define PACKAGE "libvorbis"

define VERSION "1.3.5"

define STDC_HEADERS 1

define HAVE_SYS_TYPES_H 1

define HAVE_SYS_STAT_H 1

define HAVE_STDLIB_H 1

define HAVE_STRING_H 1

define HAVE_MEMORY_H 1

define HAVE_STRINGS_H 1

define HAVE_INTTYPES_H 1

define HAVE_STDINT_H 1

define HAVE_UNISTD_H 1

define HAVE_DLFCN_H 1

define LT_OBJDIR ".libs/"

define HAVE_ALLOCA_H 1

define HAVE_ALLOCA 1

configure: exit 0

tdaede commented 9 years ago

Can you test this patch and see if it solves your problem? You will need to run ./autogen.sh and ./configure again.

https://review.xiph.org/754/

ghost commented 9 years ago

I tried testing the patch but it never solves the problem.

rillian commented 9 years ago

@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
rillian commented 9 years ago

Closing presumed fixed. Please re-open if you're still having this issue.

thigur commented 4 years ago

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.

mirabilos commented 1 year ago

I started getting this error in Debian for a software that used to build, without changing the software (but libvorbis probably was upgraded):

https://bugs.debian.org/1020058

mirabilos commented 1 year ago

Ah, -lvorbis was missing due to missing pkg-config.

rillian commented 1 year ago

That would explain it. Glad you figured it out!

geajack commented 1 year ago

You need both -lvorbis and -lvorbisenc. The full flags needed are something like:

clang -o encode -lvorbis -lvorbisenc -logg encoder_example.c