From: Johannes on
Hi

I am trying to use the round function in a C-code mex file, but I keep on getting a "undefined reference to '_round' " error.

I did include math.h (#include <math.h>)

Any ideas?
From: Ralph Schleicher on
"Johannes " <jcbekker(a)googlemail.com> writes:

> I am trying to use the round function in a C-code mex file, but I keep
> on getting a "undefined reference to '_round' " error.
>
> I did include math.h (#include <math.h>)

Which compiler? Which C library? ISO C99 has a "round" function,
BSD has "rint". "_round" smells like Microshit.

--
Ralph Schleicher <http://ralph-schleicher.de>

Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools
From: Jan Simon on
Dear Johannes!

> I am trying to use the round function in a C-code mex file, but I keep on getting a "undefined reference to '_round' " error.
>
> I did include math.h (#include <math.h>)

My math.h has no command called "round". This command is part of C99, but unfortunately we have just 2010 and this old standard is not completely implemented in e.g. LCC.

Try to create your own rounding. :-(

Kind regards, Jan