Bonjour

Lorsque je compile, avec gcc, le code ci-dessous j'obtiens l'erreur suivante:
undefined reference to `floor'

Si je commente les deux lignes printf(), l'erreur disparaît.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <regex.h>
#define LINE_LENTH 31
 
void test(int const moveSeconds, int startSecond)
{
	int tmpSecond = 0;
	int tmpMinutes = 0;	
 
	tmpMinutes = (int)floor((startSecond + moveSeconds + tmpSecond) / 60.0);
	startSecond = 60 - (startSecond + moveSeconds + tmpSecond)%60;
 
	printf("Tmp Minutes: %d", tmpMinutes);
	printf("Start Secondes: %d", startSecond);
}
Je ne vois pas le problème? Quelqu'un a t-il une solution?