[vorbis-dev] Problems linking against libvorbis.a with GnuWin32

Florian Bruckner h9651030 at miraculix.wu-wien.ac.at
Mon Jul 10 15:16:45 PDT 2000



Hi Andy,

Thanks a lot. Unfortunately the configure script doesn't know about Mingw32,
that might have been the source of my problem.

Additionally I think the macro I found in os.h is wrong. As far as I found
out should be

double rint(double d)
{
    double fraction, integral;

    integral = modf(d, &fraction);
    if (fraction < 0.5) return integral;
    else return integral + 1;
}

modf is a standard function which I found in K&R's "C Programming Language".

best regards,

Florian
-----Original Message-----
From: owner-vorbis-dev at xiph.org [mailto:owner-vorbis-dev at xiph.org]On
Behalf Of Andy Key
Sent: Monday, July 10, 2000 1:23 PM
To: vorbis-dev at xiph.org
Subject: Re: [vorbis-dev] Problems linking against libvorbis.a with
GnuWin32

Hi Florian,

Mingw32 doesn't have rint predefined, so it should use the macro.  I've
modified the #ifdef jungle in lib/os.h on my local copy to take this into
account.  Most of the time, it seems as if you can use #ifdef __GNUC__ to
take into account Mingw32 and CygWin, but this one doesn't quite work.

See if the following won't work for you in lib/os.h -- find the #ifdef's
that handle alloca() and rint() and replace them with:

#if !defined(__GNUC__) || defined(__MINGW32__)
#ifdef _WIN32
#ifndef __MINGW32
#  define alloca(x) (_alloca(x))
#endif
#  define rint      (floor((x)+0.5)
#endif
#endif

-Andy Key

>I'm trying to link against libvorbis.a using GnuWin32
>without the Cygwin layer (that is, Mingw32). Unfortunately
>the linker complains about a missing function: rint().
>This function is used a couple of times in libvorbis and
>as far as I understand this is a standard C library function.
>
>My problem is, that I cannot find rint() in any of the common DLLs
>nor do I know how MSVC resolves this function. Any ideas?????

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail 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/



More information about the Vorbis-dev mailing list