- May 10, 2016 at 11:27 am #53630
I meet an issue about head file of C language in Codescape, when I included ‘#include <math.h>’ and compile my C programme, the compiler returns ‘undefined reference to cos/sin etc’, as one attachment shows.
I modified the linkage path in environment variable, and makefile file content -Im behind the $(COBJECT) as another attachment shows. I reset the default of the Codescape app now, and the issue is still there. I attach a piece of my code snippet, I think the programme should recognize the cos()/sin()/abs() etc but it keeps throwing out errors.
Anyone who have idea to this issue?
Knowledge: Thanks for Sean Raby advice before.
1 user thanked author for this post.May 10, 2016 at 12:01 pm #53636
Inspecting the command line, it looks like you have used -Im <india, mike>.
Please try again with -lm <lima, mike>.
See https://en.wikipedia.org/wiki/NATO_phonetic_alphabet for india, mike and lima referances.
As discussed, this [-lm] is to force libm to be linked, in some cases it is not implicitly used at link time.
1 user thanked author for this post.