Help - Search - Members - Calendar
Full Version: Problem building Vorbis from source
Hydrogenaudio Forums > Lossy Audio Compression > Ogg Vorbis > Ogg Vorbis - Tech
MuncherOfSpleens
I cannot build Vorbis (newest versions of aoTuV or Xiph) shared libraries with MinGW (using configure). Ogg compiles perfectly. I type "./configure" in MSYS; everything seems to work fine. I type "make," and it works perfectly for a while until I get to this:
CODE
gcc -shared  .libs/vorbisfile.o  -L/mingw/lib ./.libs/libvorbis.dll.a  -o .libs/libvorbisfile-3.dll -W1,--image-base=0x10000000 -W1,--out-implib,.libs/libvorbisfile.dll.a
Creating library file: .libs/libvorbisfile.dll.a
.libs/vorbisfile.o:vorbisfile.c:(.text+0x73): undefined reference to `ogg_sync_pageseek'
.libs/vorbisfile.o:vorbisfile.c:(.text+0xb8): undefined reference to `ogg_sync_buffer'
.libs/vorbisfile.o:vorbisfile.c:(.text+0xec): undefined reference to `ogg_sync_wrote'
.libs/vorbisfile.o:vorbisfile.c:(.text+0237): undefined reference to `a_lot_of_other_stuff'

Here's the line it should have used:
CODE
gcc -shared  .libs/vorbisfile.o  -L/mingw/lib /mingw/lib/libogg.dll.a ./.libs/libvorbisfile.dll.a ./.libs/libvorbis.dll.a  -o .libs/libvorbisfile-3.dll -W1,--image-base=0x10000000 -W1,--out-implib,.libs/libvorbisfile.dll.a

Does anybody know why it's doing this, or how to fix it?
HotshotGG
QUOTE
Does anybody know why it's doing this, or how to fix it?


I am not sure how to fix the problem correctly by editing the compile line, but try this. Make sure you have included the proper header files or make sure the library is sharing the proper header files (in your .libs dir, etc). An undefined reference usually occurs in programming due to the fact that function name is usually mispelled. C is case sensetive. Linker can't find the function (the compiler appears to be skipping libogg for some reason). How this relates to that I am really not sure. ogg_ routines are used for writing vorbis packets in and out of an ogg container. Vorbisfile.c is trying to call another function in libogg, but it can't because it's not there. Hopefully I have at least provided some insight for you. I am sure somebody else know's exactly what the problem is. I have never seen DLL's compiled before.
gameplaya15143
I just ran into the same problem. I got libogg1.1.3 compiled and installed. I can get through ./configure ok, but when I try to 'make' it...
CODE
make[3]: Entering directory `/home/game/aotuv-b5_20061024/lib'
/bin/sh ../libtool --tag=CC --mode=link gcc  -O20 -D__NO_MATH_INLINES -fsigned-char  -DUSE_MEMORY_H   -o libvorbisfile.la -rpath /usr/local/lib -no-undefined -version-info 4:1:1 vorbisfile.lo libvorbis.la
libtool: link: warning: `/mingw/lib//libogg.la' seems to be moved
rm -fr  .libs/libvorbisfile.dll.a
gcc -shared  .libs/vorbisfile.o  -L/mingw/lib/ ./.libs/libvorbis.dll.a  -o .libs/libvorbisfile-3.dll -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libvorbisfile.dll.a
Creating library file: .libs/libvorbisfile.dll.a
.libs/vorbisfile.o(.text+0x73):vorbisfile.c: undefined reference to `ogg_sync_pageseek'
... and so on with the undefined references..

I looked in mingw/lib/ for libogg.la and it IS in there huh.gif (and I do wonder what the "//" means) My guess is that the libtool: link: warning is the whole problem. I don't know how to go about fixing this issue though.

I have been searching for a while for a solution for this, with no luck. Any ideas?
Aoyumi
When compile of the latest libvorbis (aoTuV is included) goes wrong by MSYS, please edit makefile in the "lib" directory like the following examples after "./configure."
I can do compile in this change.

CODE
LIBS =
~
OGG_LIBS = -L/usr/local/lib -logg

CODE
LIBS = -L/usr/local/lib -logg
~
OGG_LIBS = -L/usr/local/lib -logg
gameplaya15143
Thank you Aoyumi. I'll give that a try when I get home tonight smile.gif
gameplaya15143
Well, I got libvorbis to compile. But I still don't know how to build vorbis.dll I thought it would be built automatically, but I guess not.

I've spent the last few days looking for clues on how to build it with gcc, but have found nothing (everything just seems to say to use the msvc project files).

Any help would be greatly appreciated.
Aoyumi
QUOTE(gameplaya15143 @ Dec 26 2006, 05:11) *

Well, I got libvorbis to compile. But I still don't know how to build vorbis.dll I thought it would be built automatically, but I guess not.

I've spent the last few days looking for clues on how to build it with gcc, but have found nothing (everything just seems to say to use the msvc project files).

Any help would be greatly appreciated.

I recommend you to use dllwrap. This can create dll for Windows easily.

example(ogg)
CODE
cd \libogg\src\.libs
    dllwrap.exe -def \libogg\win32\ogg.def --implib oggw.dll.a bitwise.o framing.o -o ogg.dll

example(vorbis)
CODE
cd \libvorbis\lib\.libs
    dllwrap.exe -def \libvorbis\win32\vorbis.def --implib vorbisw.dll.a oggw.dll.a analysis.o bitrate.o...(the same) -o vorbis.dll

In order to perform the above-mentioned sample, please prepare a required file in advance.
gameplaya15143
[sarcasm]Wow that wasn't hard at all![/sarcasm] headbang.gif

I just finally got vorbis.dll compiled a few minutes ago. Thank you Aoyumi for your help. (oggw.dll.a and vorbisw.dll.a are cygwin things aren't they? I never had any luck with cygwin). What I ended up doing was slightly different, but is working just fine with oddcast3 happy.gif

From inside "libogg-1.1.3\src\.libs" to build ogg.dll I ran:
CODE
dllwrap -def ../../win32/ogg.def --implib libogg.dll.a bitwise.o framing.o -o ogg.dll


To make things easy on myself, I then copied libogg.dll.a bitwise.o and framing.o to the vorbis .libs directory.

From inside "aotuv-b5_20061024\lib\.libs" to build vorbis.dll I ran:
CODE
dllwrap -def ../../win32/vorbis.def -implib libvorbis.dll.a libogg.dll.a *.o
libvorbisfile.dll.a -o vorbis.dll


biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.