I used geant4 10.04 with p02 by long time, but now I need install 10.05
At the moment I have visual studio 19, cmake 3.15.3 and qt 5.13.1 with msvc 2017 32-bit prebuilt components
I made the next build: qt + multithread + opengl + gdml. The project was generated without any problem, and I think it means I have well Patch ways to Qt and etc in system settings.
After successful project generation I run the vs, choose Release and Win32 options
And then press Build → Build solution
After that I waited a long time for building and received error LINK2019 with G4interfaces.vcxproj:
LINK2019 unresolved external symbol “protected: static class G4coutDestination * G4coutDestination::masterG4coutDestination” (?masterG4coutDestination@G4coutDestination@@1PAV1@A) referenced in function “public: __thiscall G4UIQt::G4UIQt(int,char * *)” (??0G4UIQt@@QAE@HPAPAD@Z) G4interfaces D:\geant4\geant4_10_05_p01-build\source\interfaces\G4UIQt.obj
With my current (vs 19 + qt 5.13.1) setted up I can successfuly running projects in the old 10.4p2 version, that was builded year ago with visual studio 2017, without any problem
I tried to set Visual Studio 2017 (v141) in Properties → Platform toolset, but it didn’t help
Try to comment line 230 at source/interfaces/basic/src/G4UIQt.cc ( masterG4coutDestination = this;). For me it worked, but I’m not totally sure how this affects real output.
Multithreading on Windows should work since 10.5 (yes, I missed updating that part of the docs, apologies). However, note that VS2019 and Qt 5.13 are not tested or supported yet so we cannot guarantee functionality yet.
I’d suggest first trying to build Geant4 10.5 on its own, without any modifications to the source code and so other options than GEANT4_BUILD_MULTITHREADED set to ON. Let’s see if that works to see if VS2019 is o.k., then gradually add options, as the source of the problem appears to be G4QtUI.
I have experienced a very similar problem when trying to build Geant4 10.5.p01 on 10.6 on Windows. I am using VS2017 and Qt 5.12.
Geant4 10.5.p01 builds successfully when GEANT4_BUILD_MULTITHREADED is off, but fails if it is switched on.
The error is the same as reported in the initial post in this thread, and includes the text LINK2019 unresolved external symbol “protected: static class G4coutDestination * G4coutDestination::masterG4coutDestination”.