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
Sent: 11 November 2024 23:36
To: Rivers, Mark L. <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: Re: Very stange compile error on Windows
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.
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