delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/11/08:45:57

Date: Thu, 11 Jan 1996 14:30:53 +0100
From: <andrea DOT tasso AT galactica DOT it> (andrea tasso)
To: djgpp AT delorie DOT com
Reply-To: andrea DOT tasso AT galactica DOT it
Subject: undefined reference with maths (libm.a) - help !

 HI !


undefined reference for math functions

When compiling the following program with djgpp for dos

#include<math.h>
void main (void)
{

double d , n ;
d = 40.05 ;
n = sin ( d ) ;

}

with the command: gcc -lm sin.c

I get the following error message:

sin.c(.text+0x20): undefined reference to 'sin'.

The same program compile successfully with gcc for Linux.
You note that hello.c ( in \samples\hello of djgpp dist ) compile also with
djgpp for dos, and gcc see math.h, and the math
library libm.a is present.
thank you very much for your help.

ciao

andrea
///////////////////////////////||||||||||||||||\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


Andrea Tasso
Via Marino, 35
20067 - Paullo (MI)
ITALY
Tel.: 0039-2-90633230
E-Mail: andrea DOT tasso AT galactica DOT it


\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\||||||||||||||||/////////////////////////////////


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019