C round function is throwing error: "undefined reference to `round'..."

C round function is throwing error: "undefined reference to `round'..."

希望有人能帮助我。我正在研究 CS50x,并且正在研究 Pset1 - 贪心。每当我编译我的代码时,我都会收到以下错误:

/tmp/greedy-46be96.o: In function `main':
greedy.c:(.text+0x95): undefined reference to `round'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

任何帮助将不胜感激。如果问题含糊不清,我深表歉意,我已尽力深入。我在终端中使用了 man round,到处搜索,尝试了不同的解决方案,但没有任何效果。

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

int main(void)
{
    float owed;
    float change;
    float quarter = 0.25;
    float dime = 0.10;
    float nickel = 0.05;
    float penny = 0.01;

    do {
        printf("How much change is owed?: ");
        owed = GetFloat();

    } while(owed <= 0);

    change = round(owed * 100);
}

我正在使用这个命令来编译我的代码:

clang -o greedy greedy.c -lcs50

编译时应执行以下操作:

clang -o greedy greedy.c -lcs50 -lm

这将链接编译器的数学库。