HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: MuncherOfSpleens on 2006-06-09 01:13:14

Title: Problem building Vorbis from source
Post by: MuncherOfSpleens on 2006-06-09 01:13:14
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: [Select]
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: [Select]
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?
Title: Problem building Vorbis from source
Post by: HotshotGG on 2006-06-09 01:31:53
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.
Title: Problem building Vorbis from source
Post by: gameplaya15143 on 2006-12-16 02:54:47
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: [Select]
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  (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?
Title: Problem building Vorbis from source
Post by: Aoyumi on 2006-12-17 14:59:27
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: [Select]
LIBS = 
~
OGG_LIBS = -L/usr/local/lib -logg

Code: [Select]
LIBS = -L/usr/local/lib -logg
~
OGG_LIBS = -L/usr/local/lib -logg
Title: Problem building Vorbis from source
Post by: gameplaya15143 on 2006-12-18 22:41:29
Thank you Aoyumi.  I'll give that a try when I get home tonight
Title: Problem building Vorbis from source
Post by: gameplaya15143 on 2006-12-25 20:11:28
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.
Title: Problem building Vorbis from source
Post by: Aoyumi on 2007-01-03 04:50:37
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: [Select]
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: [Select]
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.
Title: Problem building Vorbis from source
Post by: gameplaya15143 on 2007-01-16 01:55:33
[sarcasm]Wow that wasn't hard at all![/sarcasm] 

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 

From inside "libogg-1.1.3\src\.libs" to build ogg.dll I ran:
Code: [Select]
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: [Select]
dllwrap -def ../../win32/vorbis.def -implib libvorbis.dll.a libogg.dll.a *.o 
libvorbisfile.dll.a -o vorbis.dll