Hello everyone,
I am new to Geant4 (and to C++) so please bear with me as I try to get the software up and running.
I have been following the steps listed in [1]:
-
I downloaded and installed Visual Studio 2019.
-
I downloaded CMake 3.15.4 and executed its installer.
-
I have downloaded Geant4 4.10.05 and extracted its contents in E:/Geant4
-
I opened the CMake GUI. After “Where is the source code” I typed “E:/Geant4/Geant4_10_05_p01”. After “Where to build the binaries” I typed “E/Geant4/Geant4_10_05-build”. (Note, these folders already exist).
-
I clicked ‘Configure’ , chose ‘Visual Studio 16 2019’ as my specified generator and made sure the ‘Use default native compilers’ radial button was selected. I clicked ‘Finish’.
-
I got a few error messages, see below. I select the boxes for ‘GEANT4_INSTALL_DATA’ and ‘GEANT4_USE_OPENGL_WIN32’.
-
I clicked ‘Configure’ and all configuration issues were resolved (no red lines).
-
I then clicked ‘Generate’. It generates the Visual Studio project file.
-
I close CMake. I open Visual Studio 2019 and I open the Geant4.sln project file that was generated.
-
I right click on ‘INSTALL’ under Solution Explorer and click ‘Build’.
-
After more than an hour, I get Build: 37 succeeded, 10 failed, 0 up-to-date, 0 skipped"
Below, I write all the error/fail messages that I found when searching through the text that printed out in the command window as the project was building.
"37>G4VisCommandsViewer.cc
37>The contents of are only available with C++17 or later.
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1221,62): error C2079: ‘filePattern’ uses undefined class ‘std::experimental::filesystem::v1::path’
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1221,63): error C2440: ‘initializing’: cannot convert from ‘G4String’ to ‘int’
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1221,54): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1260,55): error C2039: ‘directory_iterator’: is not a member of ‘std::experimental::filesystem::v1’
37>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\fstream(40): message : see declaration of ‘std::experimental::filesystem::v1’
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1260,85): error C3861: ‘directory_iterator’: identifier not found
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1261,51): error C2039: ‘directory_iterator’: is not a member of ‘std::experimental::filesystem::v1’
37>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\fstream(40): message : see declaration of ‘std::experimental::filesystem::v1’
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1261,69): error C3861: ‘directory_iterator’: identifier not found
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1264,22): error C2530: ‘file’: references must be initialized
37>G4VisCommandsViewerDefault.cc
35>Compiling…
35>G4QGSBuilder.cc
37>G4VisCommandsViewerSet.cc
35>G4QGSPNeutronBuilder.cc
37>G4VisManager.cc
35>G4QGSPLundStrFragmProtonBuilder.cc
37>G4VisStateDependent.cc
35>G4QGSPPiKBuilder.cc
37>Generating Code…
37>E:\Geant4\geant4_10_05_p01\source\visualization\management\src\G4VisCommandsViewer.cc(1266,27): error C3536: ‘file’: cannot be used before it is initialized
37>Done building project “G4vis_management.vcxproj” – FAILED.
38>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4vis_management.lib’
40>Generating Code…
38>Done building project “G4FR.vcxproj” – FAILED.
40>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4vis_management.lib’
40>Done building project “G4VRML.vcxproj” – FAILED.
39>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4vis_management.lib’
39>Done building project “G4Tree.vcxproj” – FAILED.
43>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4vis_management.lib’
43>Done building project “G4visXXX.vcxproj” – FAILED.
45>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4FR.lib’
45>Done building project “G4GMocren.vcxproj” – FAILED.
42>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4vis_management.lib’
42>Done building project “G4visHepRep.vcxproj” – FAILED.
44>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4vis_management.lib’
44>Done building project “G4RayTracer.vcxproj” – FAILED.
41>LINK : fatal error LNK1104: cannot open file ‘…\BuildProducts\Debug\lib\G4vis_management.lib’
41>Done building project “G4OpenGL.vcxproj” – FAILED.
47>EXEC : CMake error : failed to create symbolic link ‘WIN32-VC’: operation not permitted
47>CMake Error at source/visualization/FukuiRenderer/cmake_install.cmake:49 (file):
47> file INSTALL cannot find
47> “E:/Geant4/geant4_10_05-build/BuildProducts/Debug/bin/G4FR.dll”.
47>Call Stack (most recent call first):
47> source/visualization/cmake_install.cmake:37 (include)
47> source/cmake_install.cmake:57 (include)
47> cmake_install.cmake:253 (include)
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: The command “setlocal
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: “C:\Program Files\CMake\bin\cmake.exe” -DBUILD_TYPE=Debug -P cmake_install.cmake
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :cmEnd
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :cmErrorLevel
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: exit /b %1
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :cmDone
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :VCEnd” exited with code 1.
47>Done building project “INSTALL.vcxproj” – FAILED.
========== Build: 37 succeeded, 10 failed, 0 up-to-date, 0 skipped =========="
Please excuse the obnoxious length of my post. If I knew what information is redundant from the command window text, I would have removed it.
Thanks in advance.
Massimiliano
[1] http://geant4-resources.com/Geant4Tutorials/G4tutorial_files/installationGuide.pdf