Undefined reference to `sin` [duplicate]
You have compiled your code with references to the correct math.h header file, but when you attempted to link it, you forgot the option to include the math library. As a result, you can compile your .o object files, but not build your executable. As Paul has already mentioned add “-lm” to link with the … Read more