Programming in C using Eclipse in Linux is great, however when i added variables that were doubles into the "sqrt" function from the "math.h" library there was a problem that came up.
undefined reference to `sqrt'After a little bit of research, in Eclipse, go to Project > Properties > C/C++ Build > Settings > GCC C Linker > Miscellaneous > add "-lm" to the "Linker Flags" text field. That way it is properly linked to the project.
http://cboard.cprogramming.com/c-programming/88943-undefined-reference-sqrt.html
thanks. it works
ReplyDeleteThank you for help!
ReplyDeletethanks.
ReplyDeleteThank you so much!
ReplyDeleteyou helped me a lot!!!
Adicione no final da linha, conforme abaixo -lm -lc e lnosys
ReplyDelete$(EXECUTABLE): $(SRC) $(STARTUP) $(CC) $(CFLAGS) $^ -lm -lc -lnosys -o [email protected]
http://www.eevblog.com/forum/microcontrollers/stm32f4-arm-none-eabi-gcc-not-linking-to-math/
thanks!!!
ReplyDelete