Message: Installation-Feedback/Tips for Geant4.10.2 with QT5.X (on Win7) Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Installation-Feedback/Tips for Geant4.10.2 with QT5.X (on Win7) 

Forum: Installation and Configuration
Date: 04 Feb, 2016
From: Andreas Jansen <Andreas Jansen>

Hi all,

so I've literally spend days to get things to work at my place and 
thought it would be nice to give feedback for other desperate souls with 
maybe similar problems. The goal was/is to get geant4_10_02 running 
under windows7 with QT-Visualisation.

Things I used:
 > Visual Studio 2013 Community (also tested with VS2015 Community)
 > cmake-3.4.1 (win32, x86)
 > QT 5.5.1 (also tested with QT 5.4.2) - windows-x86-msvc2013
 > geant4_10_02

Install Steps:
1) Install QT at desired location (for example C:\QT)
2) Set Environment-Variables (its important to set the QT-Variables 
BEFORE installing G4!).
My Variables are:
 > Value: C:\Qt\Qt5.5.1\5.5\msvc2013\mkspecs\win32-msvc2013

 > Name: QTDIR
 > Value: C:\Qt\Qt5.5.1\5.5

 > Name: PATH (append or insert into possibly existing value-entrys! 
Seperate multiple entrys with ";")
 > Value: ...;C:\Qt\Qt5.5.1\5.5\msvc2013\bin;...

3) IMPORTANT (I guess this issue arises because Geant4 doesnt support 
multithreadding under windows yet):
Unpack your Geant4-Archiv and go to 
"...\geant4_10_02\source\interfaces\basic\src\". Edit the File "":
-> Line 196:
// explicitly request that cout/cerr messages from threads are ALSO 
propagated to the master.
masterG4coutDestination = this;
---> Edit to:
         // explicitly request that cout/cerr messages from threads are 
ALSO propagated to the master.
         masterG4coutDestination = this;

-> Line 236:
masterG4coutDestination = 0; // set to cout when UI is deleted
---> Edit to:
         masterG4coutDestination = 0; // set to cout when UI is deleted

4) Now follow the Installation Guide 
from the offcial page! (namely: 2.2. Building and Installing on Windows 
Platforms) It's important to set the "Geant4_USE_QT" Option ON! Either 
switch it on in the Cmake-UI or set an extra Argument in the Command 
promt. If you use the CommandPromt be aware that you have to choose the 
"VS20XX x86 Native Tools Command Prompt" and not the deafult one. Else 
your Environment-Variables aren't set.
The following line should work:
-DGEANT4_USE_OPENGL_WIN32=ON -DGEANT4_USE_QT=ON ".../Geant4/geant4_10_02"
(you have to be in your geant4_10_02-build directory! Also change the 
Install-Prefix to the desired path and the last path to your geant4 Path!)

5) Now one should have a geant4_10_02-build directory with lots of 
files. Just get into it with the CommandPromt (again the VS-One!) and type:
cmake --build . --config RelWithDebInfo --target install

6) Almost done! Hopefully the installation process worked out without 
errors. Else get back and check if you've done everything right (also 
READ the Installation Guide! Its awesome and a lot can be answered in 
there :))
Now one has to set the Environment-Variables for Geant4 Datasets. Thats 
a little bit confusing especially because the "How to set 
Environment-Variables" Chapter in the Installation Guide comes after the 
"Building Applications" wich won't work if the Environment-Vars aren't 
set. So just move forward to "3.3.  Note on Geant4 Datasets", set all 
the Environment-Vairables and get back in the Chapters. (for example: 

CMake gives an error if you try to build an example now. This comes from 
CMake wanting QT Version 4.XX (we have 5.XX; no Idea why its not 
configuring itself automaticly). To bypass this error get to the 
"...\geant4_10_02-install\lib\Geant4-10.2.0" directory and edit the file 
-> Line 244:
"find_package(Qt4 REQUIRED)"
---> Edit to:
"#find_package(Qt4 REQUIRED)"

8) Done. Now try to build and run exampleB1 (how to-> see Installation 
As a side note: It CAN happen that you have multiple Qt.dll's on your 
PC. (for example if you're using MikTeX for Latex) If thats the case be 
sure that your Environment-Variables are linking to the correct 
Qt.dll's! Else you will get errors like "Procedure entry Point could not 
be located in... QtXXX.dll"!

I hope this helps some people or provides some usefull Feedback 
(especially concerning the errors) for the developers.


 [ MIME part of type text/html without a name stripped ]

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: errors occurred with QT5.5.1   (Rassoul Jamshidzehi - 06 Feb, 2016)
(_ Ok: Re: errors occurred with QT5.5.1   (Andreas Jansen - 06 Feb, 2016)
 Add Message Add Message
to: "Installation-Feedback/Tips for Geant4.10.2 with QT5.X (on Win7)"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]