Problem 1796

Summary: Cannot compile GEANT4 example with ROOT6
Product: Examples/Extended Reporter: Olivier Delaune <olivier.delaune>
Component: analysis/AnaEx01Assignee: Ivana.Hrivnacova
Status: RESOLVED INVALID    
Severity: trivial    
Priority: P5    
Version: 10.1   
Hardware: All   
OS: All   

Description Olivier Delaune 2015-10-25 22:52:06 CET
I installed GEANT4 4.10.1 patch2. I tried to compile the example in "extended/analysis/AnaEx02"
Doing a classical cmake, make, it is not possible to compile successfully this example using ROOT6
A bug report was opened on the ROOT bugtracker (https://sft.its.cern.ch/jira/browse/ROOT-7748) but it is not a ROOT-related issue. Thus, I think you should add 

"include(${ROOT_USE_FILE})"
after find_package(ROOT)

as recommended here: https://sft.its.cern.ch/jira/browse/ROOT-7748?focusedCommentId=71279&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-71279

Probably this fix should be applied on all example that uses ROOT.
Comment 1 Ivana.Hrivnacova 2015-10-29 00:06:19 CET
Hello,

As ROOT6 is built against c++11 standard, you need to build Geant4 libraries against this standard, too, as the application code should use compatible libraries.
Geant4 10.1 is built by default with c++98 standard, so you have to select c++1 via CMake option:
-DGEANT4_BUILD_CXXSTD=c++11

This option is then automatically propagated to the example build via
include(${Geant4_USE_FILE})

Best regards,