Problem 2455 - virtual function Shoot already defined in G4MoleculeGun.obj
Summary: virtual function Shoot already defined in G4MoleculeGun.obj
Status: RESOLVED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/electromagnetic/dna (show other problems)
Version: 10.6
Hardware: All Windows
: P4 normal
Assignee: Sebastien Incerti
URL:
Depends on:
Blocks:
 
Reported: 2021-12-15 21:42 CET by Zahira Ammarguellat
Modified: 2022-01-19 08:11 CET (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.