[Gammaray-interest] Build failure of 2.0.0 on Windows with MSVC 2013

Igor Mironchik igor.mironchik at gmail.com
Sun Jan 19 08:27:51 CET 2014


Hi.

On windows it's impossible to build GammRay 2.0.0 with MSVC 2013...

D:\GammaRay-2.0.0\plugins\styleinspector\complexcontrolmodel.cpp(36) : 
error C24
91: 'log2' : definition of dllimport function not allowed
D:\GammaRay-2.0.0\plugins\styleinspector\complexcontrolmodel.cpp(92) : 
error C26
68: 'log2' : ambiguous call to overloaded function
         c:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\math.h(12
15): could be 'long double log2(long double) throw()'
         c:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\math.h(10
99): or       'float log2(float) throw()'
         c:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\math.h(50
4): or       'double log2(double)'
         while trying to match the argument list '(QStyle::SubControl)'
NMAKE : fatal error U1077: 'c:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe' : 
return code
'0x2'
Stop.

I simple removed this:

#if defined(_MSC_VER) || defined(Q_OS_ANDROID) // only MSVC and Android 
don't have log2()...
static double log2(double n)
{
   return log(n) / log(2.0f);
}
#endif

And

for (int i = 0; i < log2(QStyle::SC_All); ++i)

changed to

for (int i = 0; i < log2((double)QStyle::SC_All); ++i)

-- 
Best Regards,
Igor Mironchik.



More information about the Gammaray-interest mailing list