I'd like to write a DLL wrapper (BladeEnc/lame_enc style) for libvorbis. I pulled down the CVS tree today, and with very slight changes (missing typedefs for int64_t, int16_t, etc...) got it to build using gcc 2.95.2 in Win95. Unfortunately, the encoder_example segfaults. I get the same results from Cygwin as well. On a linux box with egcs 2.91.66 it builds cleanly, and appears to function correctly. So I've got a reference for tracking down what's going on, in case no one else has already run across and overcome this... :-) In any case, has anyone managed to build a working copy with either Mingw or Cygwin for 32-bit windows? ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
>In any case, has anyone managed to build a working copy with either Mingw or >Cygwin for 32-bit windows?Well, crashes are bad, and it would be great to track these down - but you don't need gcc to compile it under win32. It's very clean, close to ANSI C. It is known to compile and work perfectly with MSVC (version 5 definately, I suspect others have used version 6). I doubt other windows compilers are going to be much different - 'porting' the code basically consisted of adding a few missing headers, defining int64_t and similar types, and defining a few things to work around weirdnesses in MSVC (like _alloca() instead of alloca()) However, the programs using the library WILL need to be modified to run on windows platforms (unless you're using cygwin, which makes it look unixy enough). Most notably, the encoder and decoder examples use stdin and stdout. You need to switch these to binary mode before doing anything. However, none of that should be causing segfaults - it'd be great if you could jump into the code and try and track down where that's happening. The idea is that libvorbis should be portable to pretty much any ANSI C compiler that is available. Michael --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
> >In any case, has anyone managed to build a working copy with either Mingw >or > >Cygwin for 32-bit windows? > >Well, crashes are bad, and it would be great to track these down - but you >don't need gcc to compile it under win32. It's very clean, close to ANSI C.Actually, the need to use Mingw is mine -- I've written and maintain a few rippers for Win32, plus a DLL, and my goal is that everything I put out has to compile with freely available tools. It should also compile with commercial tools.> >It is known to compile and work perfectly with MSVC (version 5 definately, >I suspect others have used version 6). I doubt other windows compilers are >going to be much different - 'porting' the code basically consisted of >adding a few missing headers, defining int64_t and similar types, and >defining a few things to work around weirdnesses in MSVC (like _alloca() >instead of alloca())I didn't have to add any new headers, but I did have to add in the int64_t and int16_t typedefs, and change srandom() to srand(), random() to rand().>Most notably, the encoder and decoder examples use stdin and stdout. You >need to switch these to binary mode before doing anything.Actually, I replaced references to stdin/stdout to hard-coded file names to make running under gdb a little easier.>However, none of that should be causing segfaults - it'd be great if you >could jump into the code and try and track down where that's happening. The >idea is that libvorbis should be portable to pretty much any ANSI C >compiler that is available.I know the line of code where it's happening... come to think of it, it's doing a memcpy() into a buffer that's just been returned from alloca(), in the function _ve_deltas() in envelope.c. I'll try replacing that with a normal malloc/free and see if that doesn't help things out. -Andy ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
Michael and I both both it working fairly easy with VC++. I'm sure the ;lib file that we compiled could easily become a dll with a linking flag changed. jack. On Thu, 13 Apr 2000, Andy Key wrote:> I'd like to write a DLL wrapper (BladeEnc/lame_enc style) for libvorbis. I > pulled down the CVS tree today, and with very slight changes (missing > typedefs for int64_t, int16_t, etc...) got it to build using gcc 2.95.2 in > Win95. Unfortunately, the encoder_example segfaults. I get the same > results from Cygwin as well. > > On a linux box with egcs 2.91.66 it builds cleanly, and appears to function > correctly. So I've got a reference for tracking down what's going on, in > case no one else has already run across and overcome this... :-) > > In any case, has anyone managed to build a working copy with either Mingw or > Cygwin for 32-bit windows? > ______________________________________________________ > Get Your Private, Free Email at http://www.hotmail.com > > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > Ogg project homepage: http://www.xiph.org/ogg/ >--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/