I’m using math function like tan, cos, sin in one of my .c files. I have included in the file but still got error:
undefined reference to tan' undefined reference tocos'
I searched online and most of suggestions are to add -lm in the end of gcc command. Something like: gcc -pedantic -Wall -o theaded_program pth.c -pthread -lm
But I’m using Softconsole GUI. How do I fix this problem?
I’m using math function like tan, cos, sin in one of my .c files. I have included in the file but still got error:
undefined reference to
tan' undefined reference to
cos'I searched online and most of suggestions are to add -lm in the end of gcc command. Something like: gcc -pedantic -Wall -o theaded_program pth.c -pthread -lm But I’m using Softconsole GUI. How do I fix this problem?