title: C: Undefined reference to floor
body: <p>I am using Eclipse on Ubuntu to write/compile/run C code.
  I am trying to build my project.
  Following is the output in the Eclipse console.</p>
  
  <pre><code>22:18:31 **** Build of configuration Debug for project Project1 ****
  make all 
  Building file: ../project1.c
  Invoking: GCC C Compiler
  gcc -I/lib/i386-linux-gnu -O0 -g3 -Wall -c -fmessage-length=0 -pthread -lm -MMD -MP -MF"project1.d" -MT"project1.d" -o "project1.o" "../project1.c"
  ../project1.c: In function ‘main’:
  ../project1.c:146:6: warning: unused variable ‘this_thread_id’ [-Wunused-variable]
  ../project1.c: In function ‘_pre_init’:
  ../project1.c:126:1: warning: control reaches end of non-void function [-Wreturn-type]
  Finished building: ../project1.c
  
  Building file: ../scheduler.c
  Invoking: GCC C Compiler
  gcc -I/lib/i386-linux-gnu -O0 -g3 -Wall -c -fmessage-length=0 -pthread -lm -MMD -MP -MF"scheduler.d" -MT"scheduler.d" -o "scheduler.o" "../scheduler.c"
  Finished building: ../scheduler.c
  
  Building target: Project1
  Invoking: GCC C Linker
  gcc -L/lib/i386-linux-gnu -lm -pthread -o "Project1"  ./project1.o ./scheduler.o   
  ./project1.o: In function `advance_global_time':
  /home/akshay/Cworkspace/Project1/Debug/../project1.c:50: undefined reference to `floor'
  collect2: ld returned 1 exit status
  make: *** [Project1] Error 1
  </code></pre>
  
  <p>Can anyone please help me figure out what the problem is and how to solve it?</p>