Error compiling a solution in C++ in visual studio 2017
I'm trying to compile a c ++ solution, but it's not working. Can anyone help me?
I opened a visual studio 2008 solution in visual studio 2017. When I give the build the error happens. I did not find in the project Where is inclusion of these headers (float.h and corecrt_math.h). Has anyone had a similar problem?
I am using Windows SDK 10.0.17763.0 and Visual Studio 2017.
Error:
c:\program files (x86)\windows kits\10\include\10.0.17763.0\ucrt\float.h(311): error C2556: 'double _logb(double)': overloaded function differs only by return type from 'int _logb(double)'
c:\program files (x86)\windows kits\10\include\10.0.17763.0\ucrt\corecrt_math.h(512): note: see declaration of '_logb'
c:\program files (x86)\windows kits\10\include\10.0.17763.0\ucrt\float.h(311): error C2371: '_logb': redefinition; different basic types
c:\program files (x86)\windows kits\10\include\10.0.17763.0\ucrt\corecrt_math.h(512): note: see declaration of '_logb'
Corecrt_math.h:
_Check_return_ _ACRTIMP int __cdecl ilogb(_In_ double _X);
Float.h:
_Check_return_ _ACRTIMP double __cdecl _logb(_In_ double _X);
1 answers
In C++ it is illegal to overload two functions that differ only by the return type.
_Check_return_ _ACRTIMP int __cdecl ilogb(_In_ double _X);
_Check_return_ _ACRTIMP double __cdecl _logb(_In_ double _X);
The first thing to do is remove the include " corecrt_math.h " which appears to be an internal Microsoft C++ include, and see if the project compiles.
If this doesn't work, you'll have to figure out which sources depend on this include "corecrt_math.h", and compile apart from these sources.