[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] using the sin function in rtlinux



> I have included math.h in my source file, but gcc says that the reference to sin is undefined. what should I do?
> 
including math.h is step 1 but you need to link the libs in aswell so add a 
 -lm to the linker options ( libm is not included by default !) including 
libm requires libc in most (all ?) cases so you will have to add a -lc aswell 
and then for gcc to do its magic cleanups add -L/PATH/TO/GCC/LIB -lgcc .

you also need to statically link the libs , so add -static to the ld flags

hofrat