0

I'm trying to build Qt 5.2.0 from source using Visual Studio 2012. It is failing while compiling the following file:

/qtdeclarative/src/qml/jsruntime/qv4value_p.h

With the following error:

191: error C2039: _isnan: is not a member of std

Line 191 contains the following:

return doubleValue() && !std::isnan(doubleValue());

According to cppreference, std::isnan should be defined in the header cmath, since C++11. The Qt header file does include this header. When I inspect cmath in Visual Studio, I cannot see a function named isnan.

Am I right in concluding that VS2012 is missing this C++11 function? At first I thought I might have to enable C++11 support somehow, but according to this answer C++11 support is enabled by default. Given that binary downloads for Qt are available for VS2010 and VS2012, clearly it is possible to build with the respective compilers. Is there something I am missing?

Community
  • 1
  • 1
JBentley
  • 6,099
  • 5
  • 37
  • 72
  • What are your Qt configure options? Can you try building 5.2.1? What puzzles me is that a VS2012 build is amongst the continuous integration builds of Qt http://qt-project.org/wiki/CI_Configurations http://testresults.qt-project.org/ci/QtDeclarative_stable_Integration/latest-success/ – peppe Jan 22 '14 at 17:25

1 Answers1

1

isnan was implemented in Visual Studio'sstandard library starting with Visual Studio 2013.

There's most likely some sort of define to tell it that you don't have std::isnan available.

Collin Dauphinee
  • 13,664
  • 1
  • 40
  • 71
  • I would try `#ifdef isnan` as a check, if function is not defined then this symbol should be available as a macro (macro explains error message). – Marek R Jan 22 '14 at 17:29
  • Thank you. I am going to try passing -no-c++11 to Qt's configure tool and see if that works. If not, I will check the defines as you suggested. – JBentley Jan 22 '14 at 19:19
  • I just glanced at the code and there's no way this will compile with VS2010 or 2012. My guess is that this module isn't included. – Collin Dauphinee Jan 22 '14 at 19:25