Itzik984
Itzik984

Reputation: 16794

Undefined reference to `round' c language

I'm using those imports

#include <stdio.h>
#include <math.h>

and I'm getting undefined reference to `round' at this line:

double res = round(atof(nextVal));

nextVal is a double value read from a file.

I'm using Eclipse INDIGO.

Upvotes: 4

Views: 11721

Answers (1)

Aif
Aif

Reputation: 11220

In command line, you must specify -lm option to gcc to link the math lib. You have to find how to do so in eclipse.

Upvotes: 15

Related Questions