简体   繁体   中英

Qt build fails due to missing std::isnan in Visual Studio 2012

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM