Problem 2455

Summary: virtual function Shoot already defined in G4MoleculeGun.obj
Product: Geant4 Reporter: Zahira Ammarguellat <zahira.ammarguellat>
Component: processes/electromagnetic/dnaAssignee: Sebastien Incerti <incerti>
Status: RESOLVED WONTFIX    
Severity: normal CC: incerti, zahira.ammarguellat
Priority: P4    
Version: 10.6   
Hardware: All   
OS: Windows   

Description Zahira Ammarguellat 2021-12-15 21:42:23 CET
Compilation with clang on Windows using VS2019 generator, is generating this error:
 error LNK2005: "public: virtual void __cdecl TG4MoleculeShoot<class G4Track>::Shoot(class G4MoleculeGun *)" (?Shoot@?$TG4MoleculeShoot@VG4Track@@@@UEAAXPEAVG4MoleculeGun@@@Z) already defined in G4MoleculeGun.obj 

The pure virtual function Shoot is instantiated twice. The first one is in 
G4shared_ptr<G4MoleculeShoot> output(new TG4MoleculeShoot<TYPE>);
and the second one is in the explicit specialization 
template<>
void TG4MoleculeShoot<G4Track>::Shoot(G4MoleculeGun* gun).
Comment 1 Gabriele Cosmo 2022-01-19 08:11:53 CET
The clang compiler is not supported on Windows. Please, see the list of supported systems/compilers in the release notes.