[Vorbis-dev] vorbis-tools 1.4.0, ogg123 and MinGW

LM lmemsm at gmail.com
Wed Feb 13 08:25:57 PST 2013


Hope this is the right location to post this.

Was looking at vorbis-tools version 1.4.0.  (By the way the wiki page
at https://wiki.xiph.org/Vorbis-tools is still pointing to 1.2.0.)  I
tried compiling with MinGW ( from http://www.mingw.org ).  It builds
except for the ogg123 program.  Even though there's an
--enable-threads=win32 for configure, doesn't look like it does
anything.

On MinGW a pthread_t is defined as a struct not an int:

typedef struct {
    void * p;
    unsigned int x;
} ptw32_handle_t;
typedef ptw32_handle_t pthread_t;

The configure test to check if pthreads is available is:

int
main ()
{
pthread_t th; pthread_join(th, 0);
                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
                     pthread_create(0,0,0,0);
                     pthread_cancel(0); pthread_cleanup_pop(0);
  ;
  return 0;
}

It's assuming a pthread_t could be equal to 0 (an int) which fails
when building with MinGW.

I changed the code as follows and it at least causes configure to find
my pthread library.

pthread_t th; pthread_join(th, 0);
                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
                     pthread_create(&th,0,0,0);
                     pthread_cancel(th); pthread_cleanup_pop(0);

There are some other issues with ogg123 that keep it from compiling as
is once this is fixed.  I patched a few things and I now have
vorbis-tools 1.4.0 compiling and building to completion and an
ogg123.exe is created.  Haven't had a chance to test if anything
works, but it at least builds.  Was wondering if it would be helpful
to share the patches.  I couldn't find any instructions elsewhere for
getting vorbis-tools to compile with MinGW and the win32 binary (at
http://xiph.org/downloads/) is 1.2.0.  So, maybe no one's tried to
build 1.4.0 or at least share information on how to build it for
Windows using MinGW?  Is there someplace to send patches to?

Sincerely,
Laura
http://www.distasis.com/cpp


More information about the Vorbis-dev mailing list