Menu

#43 MinGW build failure

1.9.0
open
nobody
None
7
2006-05-15
2006-05-15
No

First off, nice-looking library.

1. The source files "threads_posix.cpp" and
"timer_posix.cpp" require the definitions of struct
timezone and function gettimeofday, which are present
in the <sys/time.h> header file included in normal GCC
distributions. However, these definitions are absent
from the current (GCC 3.4.2) MinGW distribution. The
file attached to this post, intended to replace
<sys/time.h>, is almost an exact copy of <timeval.h>,
available at
<http://mywebpage.netscape.com/yongweiwu/time.htm>,
except that it doesn't #define WIN32_LEAN_AND_MEAN. (I
defined that macro in configure.in, since I was using
WinMM instead of DirectSound; your recommended
placement may be different.)

2. The source file "threads_posix.cpp" also requires
the definitions of functions sleep and usleep, which
are also absent from MinGW. I replaced the body of
"void AI_Sleep(unsigned milliseconds)" with:

#if defined(WIN32) || defined(_WIN32)
Sleep(milliseconds);
#else
int seconds = milliseconds / 1000;
int useconds = (milliseconds % 1000) * 1000;

sleep(seconds);
usleep(useconds);
#endif

3. Audiere has an undocumented dependency on pthreads.
Win32 users can download an implementation from
<http://sourceware.org/pthreads-win32/>, but
installation of this particular library is not so
straightforward. (There are several possible build
targets, none of which are the default, and you must
begin with clean; the one I used was "make clean gce;
make install". Afterwards I had to manually move and
rename the .a and .def files from the pthreads
directory, in addition to moving the DLL to /mingw/bin.)

4. When built with MSYS/MinGW, the FLAC, libogg,
libvorbis, and Speex DLL import libraries are named
libflac.dll.a, libogg.dll.a, libvorbis.dll.a, and
libspeex.dll.a, respectively. In configure.in, I
changed the linker flags accordingly.

5. The AUDIERE_EXPORTS flag was not #defined during
building. I defined it near the beginning of
configure.in and got rid of the resulting compiler errors.

6. I get linker errors when attempting to build with
Speex support (specifically, the simple.cpp example
program). I had to disable it.

7. The net result was a static library, not a DLL as I
was led to expect. But at least the example programs
work now.

Cromwell D. Enage

Discussion

  • Cromwell Enage

    Cromwell Enage - 2006-05-15

    Replacement of <sys time.h=""> for MinGW distributions of GCC 3.4.2</sys>

     
  • Cromwell Enage

    Cromwell Enage - 2006-05-15
    • priority: 5 --> 7
     

Log in to post a comment.

MongoDB Logo MongoDB