【问题标题】:Undefined reference to `round' c language对“round”c语言的未定义引用
【发布时间】:2011-11-06 09:24:31
【问题描述】:

我正在使用这些导入

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

我在这一行得到对“round”的未定义引用

double res = round(atof(nextVal));

nextVal 是从文件中读取的双精度值。

我正在使用 Eclipse INDIGO。

【问题讨论】:

    标签: c eclipse compiler-errors


    【解决方案1】:

    在命令行中,您必须为 gcc 指定 -lm 选项以链接数学库。你必须在eclipse中找到如何做到这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多