I was compiling ANSI-C in VS2012 (with _CRT_SECURE_NO_WARNINGS set) and the program uses "math.h". And I encounter the following problems:
sqrt()
The automatic checker for VS2012 will tell me there is an error
IntelliSense: more than one instance of overloaded function "sqrt" matches the argument list:
function "sqrt(double _X)" function "sqrt(float _X)" function "sqrt(long double _X)" argument types are: (int)
but the project will still build. It confuses me because I think C doesn't support function overloading?
Debug with fabs()
After the project builds I tried to debug. When it runs to the line
char eq(double a, double b, double epsilon) {
return (fabs(a - b) < epsilon); // problem
}
function, it will build but in debug mode it will generate an error page "fabs.c not found":
I am not sure what's going on. It seems the problem only happens in Debug mode. When I run the compiled program .exe in command line it works fine.