Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'isnan' was not declared in this scope if (isnan(t)) ;这样的问题怎么解决? #58

Open
changtj opened this issue Apr 19, 2018 · 1 comment

Comments

@changtj
Copy link

changtj commented Apr 19, 2018

H:\vcpkg\downloads\log4z-master\g++>cmake -Dlog4z_SOURCE_DIR=".." -G "MinGW Makefiles"
CMake Error: Error: generator : MinGW Makefiles
Does not match the generator used previously: Visual Studio 15 2017
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

H:\vcpkg\downloads\log4z-master\g++>cmake -Dlog4z_SOURCE_DIR=".." -G "MinGW Makefiles"
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: C:/Qt/Qt5.9.2/Tools/mingw530_32/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Qt5.9.2/Tools/mingw530_32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Qt/Qt5.9.2/Tools/mingw530_32/bin/g++.exe
-- Check for working CXX compiler: C:/Qt/Qt5.9.2/Tools/mingw530_32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: H:/vcpkg/downloads/log4z-master/g++

H:\vcpkg\downloads\log4z-master\g++>mingw32-make
Scanning dependencies of target log4z
[ 50%] Building CXX object CMakeFiles/log4z.dir/H_/vcpkg/downloads/log4z-master/log4z.cpp.obj
In file included from H:\vcpkg\downloads\log4z-master\log4z.cpp:37:0:
H:\vcpkg\downloads\log4z-master\log4z.h: In member function 'zsummer::log4z::Log4zStream& zsummer::log4z::Log4zStream::writeDouble(double, bool)':
H:\vcpkg\downloads\log4z-master\log4z.h:810:16: error: 'isnan' was not declared in this scope
if (isnan(t))
^
H:\vcpkg\downloads\log4z-master\log4z.h:810:16: note: suggested alternative:
In file included from H:\vcpkg\downloads\log4z-master\log4z.h:193:0,
from H:\vcpkg\downloads\log4z-master\log4z.cpp:37:
C:/Qt/Qt5.9.2/Tools/mingw530_32/i686-w64-mingw32/include/c++/cmath:862:5: note: 'std::isnan'
isnan(_Tp __f)
^
In file included from H:\vcpkg\downloads\log4z-master\log4z.cpp:37:0:
H:\vcpkg\downloads\log4z-master\log4z.h:815:21: error: 'isinf' was not declared in this scope
else if (isinf(t))
^
H:\vcpkg\downloads\log4z-master\log4z.h:815:21: note: suggested alternative:
In file included from H:\vcpkg\downloads\log4z-master\log4z.h:193:0,
from H:\vcpkg\downloads\log4z-master\log4z.cpp:37:
C:/Qt/Qt5.9.2/Tools/mingw530_32/i686-w64-mingw32/include/c++/cmath:853:5: note: 'std::isinf'
isinf(_Tp __f)
^
H:\vcpkg\downloads\log4z-master\log4z.cpp: In member function 'virtual zsummer::log4z::LogData* zsummer::log4z::LogerManager::makeLogData(LoggerId, int)':
H:\vcpkg\downloads\log4z-master\log4z.cpp:1262:38: warning: 'thread' attribute directive ignored [-Wattributes]
static __declspec(thread) tm g_tt = { 0 };
^
H:\vcpkg\downloads\log4z-master\log4z.cpp:1263:42: warning: 'thread' attribute directive ignored [-Wattributes]
static declspec(thread) time_t g_curDayTime = 0 ;
^
CMakeFiles\log4z.dir\build.make:61: recipe for target 'CMakeFiles/log4z.dir/H
/vcpkg/downloads/log4z-master/log4z.cpp.obj' failed
mingw32-make[2]: *** [CMakeFiles/log4z.dir/H
/vcpkg/downloads/log4z-master/log4z.cpp.obj] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/log4z.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/log4z.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

H:\vcpkg\downloads\log4z-master\g++>g++
g++: fatal error: no input files
compilation terminated.

H:\vcpkg\downloads\log4z-master\g++>mingw32-make -version
GNU Make 4.1
Built for i686-w64-mingw32
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

H:\vcpkg\downloads\log4z-master\g++>

@changtj changtj changed the title 'isnan' was not declared in this scope if (isnan(t)) 'isnan' was not declared in this scope if (isnan(t)) ;这样的问题怎么解决? Apr 19, 2018
@vrqq
Copy link

vrqq commented May 1, 2018

试试在前面加上std:: 变成std::isnan std::isinf

然后打一下__cpluscplus看看是不是这个原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants