Problem 2582 - Compiling on windows system generate an error C2039: '_finite': is not a member of 'std'
Summary: Compiling on windows system generate an error C2039: '_finite': is not a memb...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: config (show other problems)
Version: other
Hardware: PC Windows
: P4 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2023-12-15 06:08 CET by Thomas Frosio
Modified: 2024-01-14 17:33 CET (History)
1 user (show)

See Also:


Attachments
Proposed fix as implemented and tested (5.31 KB, patch)
2024-01-14 17:33 CET, Ben Morgan
Details | Diff

Note You need to log in before you can comment on or make changes to this problem.
Description Thomas Frosio 2023-12-15 06:08:24 CET
When trying to compile on windows MSBuild version 17.8.3+195e7f5a3 for .NET Framework, the following error happens:

D:\MicrosoftVisualStudio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xlocnum(1398,76): error C2039: '_finite': is
not a member of 'std' [D:\Libraries\GEANT4\geant4_build_windows\source\G4processes.vcxproj]

This issue is solved by changing the following:
1) In geant4/source/processes/hadronic/models/lend/src/nf_stringToDoubles.cc, replace line 13 by   #define isfinite isfinite instead of   #define isfinite _finite
2) In geant4/source/processes/hadronic/models/lend/include/nf_specialFunctions.h, replace line 14 by   #define isfinite isfinite instead of   #define isfinite _finite

The same might be necessary in geant4/examples/extended/electromagnetic/TestEm7/include/c2_function.hh line 48 but I did not test the compilation of this example.

Best regards,
Thomas
Comment 1 Thomas Frosio 2023-12-15 06:25:45 CET
I forgot to mention that the issue is encountered with the last G4 version 11.2.0
Comment 2 Gabriele Cosmo 2023-12-19 08:36:11 CET
Thanks for reporting the issue. A fix is now pushed in the development branch and will be available in the next patch release.
Comment 3 Ben Morgan 2024-01-14 17:33:13 CET
Created attachment 843 [details]
Proposed fix as implemented and tested

Proposed fix as implemented and tested, posted here to allow cross-reference from forum