Thread overview
Which import lib holds lrintf()?
Apr 27, 2011
Andrej Mitrovic
Apr 27, 2011
Jesse Phillips
Apr 27, 2011
Andrej Mitrovic
Apr 28, 2011
Don
Apr 28, 2011
Andrej Mitrovic
April 27, 2011
import std.c.math : lrintf;

void main()
{
    lrintf(4.0);
}

Error 42: Symbol Undefined _lrintf
--- errorlevel 1
April 27, 2011
Andrej Mitrovic Wrote:

> import std.c.math : lrintf;
> 
> void main()
> {
>     lrintf(4.0);
> }
> 
> Error 42: Symbol Undefined _lrintf
> --- errorlevel 1

Just a guess, libm?

dmd testfile.d -L-lm

m is the C math library for linux right? Windows I don't know.
April 27, 2011
I have a hunch that this function is only available on Linux. If that's so it should maybe be put in a version(linux) statement.

But I just found lrint is in std.math as well so I can actually use that.
April 28, 2011
Andrej Mitrovic wrote:
> I have a hunch that this function is only available on Linux. If
> that's so it should maybe be put in a version(linux) statement.
> 
> But I just found lrint is in std.math as well so I can actually use that.

There should be no reason to use anything from c.math.
April 28, 2011
Okay. Some C code used lrintf() so I was trying to find it to port it to D.