1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Very stange compile error on Windows |
From: | Freddie Akeroyd - STFC UKRI via Tech-talk <tech-talk at aps.anl.gov> |
To: | "'Johnson, Andrew N.'" <anj at anl.gov>, "Rivers, Mark L." <rivers at cars.uchicago.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Tue, 12 Nov 2024 00:00:24 +0000 |
Hi Mark, This does look like the same error reported at
Compile error with isnan/isinf and Visual Studio 2022 17.11.1 · Issue #541 · epics-base/epics-base – I saw this after I had updated the compiler, so I can only suggest as Andrew has that somehow
your compiler has received an automatic update of some sort. Regards, Freddie From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Johnson, Andrew N. via Tech-talk Hi Mark, Can you try replacing the modules/libcom/src/osi/os/WIN32/epicsMath.h file in your version of Base 7.0.7 with the one from the 7.0 branch of git? Freddie added some guards in August which might
be relevant to this error, although I’m not sure of that. I’m speculating that your MSVC header files might have somehow received an automatic update which broke this compilation. - Andrew -- Complexity comes for free, Simplicity you have to work for. On 11/11/24, 5:12 PM, "Tech-talk"
<tech-talk-bounces at aps.anl.gov> wrote: Folks, I just tried to build ADCore on Windows, which has worked fine in the past. Today I got an error compiling ADApp/pluginSrc/NDPluginCircularBuff.cpp. I managed to reduce the problem to a 2-line test program that fails to compile. This is test.cpp. #include <epicsMath.h> #include <epicsTime.h> This is the error output when test.cpp is compiled: cl -EHsc -GR -DBUILDING_NDPlugin_API -nologo -FC -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ox -Oy- -W3 -w44355
-w44344 -w44251 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -DHAVE_JPEG -DHAVE_BLOSC -DHAVE_BITSHUFFLE -DLIBXML_STATIC -DLIBTIFF_STATIC -DH5_BUILT_AS_STATIC_LIB -MT -TP -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/msvc -I../../../include/os/WIN32
-I../../../include -IJ:/epics/support/asyn-4-44-2/include -IJ:/epics/support/areaDetector-3-13/ADSupport/include/os/WIN32 -IJ:/epics/support/areaDetector-3-13/ADSupport/include -IJ:/epics/support/areaDetector-3-13/ADCore/include -IH:/epics/base-7.0.7/include/compiler/msvc
-IH:/epics/base-7.0.7/include/os/WIN32 -IH:/epics/base-7.0.7/include -c ../test.cpp test.cpp C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): error C2588: '::!_finite': illegal global finalizer C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): error C2143: syntax error: missing ')' before '!' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): error C2143: syntax error: missing ';' before '!' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): error C2270: '_finite': modifiers not allowed on nonmember
functions C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): error C2588: '::!_isnan': illegal global finalizer C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): error C2059: syntax error: ')' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): error C4430: missing type specifier - int assumed. Note:
C++ does not support default-int C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): error C2556: 'bool _isnan(signed char) noexcept': overloaded
function differs only by return type from 'int _isnan(signed char) noexcept' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): note: see declaration of '_isnan' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): error C2371: '_isnan': redefinition; different basic types C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): note: see declaration of '_isnan' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): error C2556: 'bool _isnan(unsigned char) noexcept': overloaded
function differs only by return type from 'int _isnan(unsigned char) noexcept' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): note: see declaration of '_isnan' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): error C2556: 'bool _isnan(short) noexcept': overloaded
function differs only by return type from 'int _isnan(short) noexcept' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): note: see declaration of '_isnan' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): error C2556: 'bool _isnan(unsigned short) noexcept': overloaded
function differs only by return type from 'int _isnan(unsigned short) noexcept' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): note: see declaration of '_isnan' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): error C2556: 'bool _isnan(int) noexcept': overloaded function
differs only by return type from 'int _isnan(int) noexcept' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): note: see declaration of '_isnan' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): error C2556: 'bool _isnan(unsigned int) noexcept': overloaded
function differs only by return type from 'int _isnan(unsigned int) noexcept' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(831): note: see declaration of '_isnan' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\cmath(832): fatal error C1003: error count exceeds 100; stopping compilation make[1]: *** [H:/epics/base-7.0.7/configure/RULES_BUILD:267: test.obj] Error 2 make[1]: Leaving directory 'J:/epics/support/areaDetector-3-13/ADCore/ADApp/pluginSrc/O.windows-x64-static' make: *** [H:/epics/base-7.0.7/configure/RULES_ARCHS:58: install.windows-x64-static] Error 2 If I reverse the order of the 2 includes in test.cpp, i.e. include epicsTime.h before epicsMath.h then it builds fine. cl -EHsc -GR -DBUILDING_NDPlugin_API -nologo -FC -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ox -Oy- -W3 -w44355
-w44344 -w44251 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -DHAVE_JPEG -DHAVE_BLOSC -DHAVE_BITSHUFFLE -DLIBXML_STATIC -DLIBTIFF_STATIC -DH5_BUILT_AS_STATIC_LIB -MT -TP -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/msvc -I../../../include/os/WIN32
-I../../../include -IJ:/epics/support/asyn-4-44-2/include -IJ:/epics/support/areaDetector-3-13/ADSupport/include/os/WIN32 -IJ:/epics/support/areaDetector-3-13/ADSupport/include -IJ:/epics/support/areaDetector-3-13/ADCore/include -IH:/epics/base-7.0.7/include/compiler/msvc
-IH:/epics/base-7.0.7/include/os/WIN32 -IH:/epics/base-7.0.7/include -c ../test.cpp test.cpp (no error) I was able to fix the problem with compiling NDPluginCircularBuff.cpp by including epicsTime.h before epicsMath.h. There are 2 things that I don’t understand:
·
Why is this failing to compile.
·
Why did it previously work? I have not knowingly updated Visual Studio or EPICS base (7.0.7), and NDPluginCircularBuffer.cpp was last changed in
2020. Thanks, Mark |