I have recently run into an issue of not being able to use the math.h cosine function with an argument that is a variable if TCWPM_WriteCompare() is present. It doesn't even seem to matter if WriteCompare() is opperating on the same variable that cos() is. A compiler error is generated of "Build error: undefined reference to 'cos'." See below for relevant code snippet.
double a = 0; double b = 0;
b = cos(a);
A bare bones project demonstrating this issue is attached. Any feedback on what is causing this error would be appreciated.