I am able to complile a very basic code for detector construction but when I run it it does not show me the interactive pop-up window for visualization in Geant4. Instead I get the error: Segmentation fault (core dumped). Can someone help me solve the issue?
CMakeLists.txt
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(Simulation)
find_package(Geant4 REQUIRED ui_all vis_all)
include(${Geant4_USE_FILE})
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.hh)
add_executable(sim sim.cc ${sources} ${headers})
target_link_libraries(sim ${Geant4_LIBRARIES})
add_custom_target(Simulation DEPENDS sim)
I am also attaching the relevant files where I think the problem might be.
I was able to visualize it before I tried implementing the sensitive detector part in construction.cc :
void MyDetectorConstruction::ConstructSDandField()
{
MySensitiveDetector *sensDet = new MySensitiveDetector("SensitiveDetector");
logicDetector->SetSensitiveDetector(sensDet);
}
construction.cc (3.4 KB)
construction.hh (839 Bytes)
detector.cc (263 Bytes)
detector.hh (303 Bytes)