Problem of C program include "math.h"

willisfield galaxyhpc at yahoo.com
Sun Mar 5 01:04:38 UTC 2006


Hi, aleix!
    You are right, I made a mistake in compiling the
*.c files, the -lm option should be added in the last
place of the compile command, but I added it before
the *.c files. By the way, the return of the 
"sparc-rtems-gcc -v " command is: gcc version 3.2.3.
    Thank you very much!
willisfield

--- Aleix Conchillo Flaqu� <aconchillo at ieec.fcr.es>
wrote:

> Hi,
> 
> this code works fine for me,
> 
> int
> main (void)
> {
>    float f = sin (0);
> }
> 
> I use  sparc-rtems4.6.1-gcc:
> 
> sparc-rtems4.6.1-gcc example.c -lm
> 
> If you run sparc-rtems4.6.1-objdump, the sin code is
> successfuly  
> generated.
> 
> Which toolchain version are you using? How did you
> build it?
> 
> Regards,
> 
> aleix
> 
> On 02 Mar 2006, at 11:28, willisfield wrote:
> 
> >
> > Hi,all!
> >     I include "math.h" in a my C program but the
> sparc-rtems-gcc  
> > compiler doesn't recognize some of the functions
> such as "sin()".  
> > In gcc, I have hear of the option "-lm" works, but
> the sparc-rtems- 
> > gcc doesn't work.
> >     Can you give me some hints, thanks very much!
> > 	Best regards
> > willisfield
> >
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the users mailing list