Details
-
Bug
-
Status: Closed (View Workflow)
-
High
-
Resolution: Fixed
-
6.14/04
-
None
-
None
-
Fedora 28; Geant4v10.3.2
Description
thread_lock and thread_unlock typedefs are both in the global namespace, so Geant4 and ROOT can not be used together.
I am not sure whether this is an issue that should be fixed in ROOT or Geant4, but in either case it currently prevents us from using ROOT without working around it by removing/patching its headers.
Steps to reproduce:
gROOT->ProcessLine("#include \"Geant4/G4TransportationManager.hh\""); |
TVirtualMC();
|
Error:
/home/ol11/Projects/ship_software/sw/fedora28_x86-64/GEANT4/v10.3.2-3/include/Geant4/G4Threading.hh:186:19: error: typedef redefinition with different types ('G4int (*)(G4Mutex *)' (aka 'int (*)(int *)') vs
|
'int (*)(TMCMutex *)' (aka 'int (*)(pthread_mutex_t *)'))
|
typedef G4int (*thread_lock)(G4Mutex*);
|
^
|
/home/ol11/Projects/ship_software/sw/fedora28_x86-64/ROOT/master-1/include/TMCAutoLock.h:98:15: note: previous definition is here
|
typedef int (*thread_lock)(TMCMutex *);
|
^
|
and
/home/ol11/Projects/ship_software/sw/fedora28_x86-64/GEANT4/v10.3.2-3/include/Geant4/G4Threading.hh:187:19: error: typedef redefinition with different types ('G4int (*)(G4Mutex *)' (aka 'int (*)(int *)') vs
|
'int (*)(TMCMutex *)' (aka 'int (*)(pthread_mutex_t *)'))
|
typedef G4int (*thread_unlock)(G4Mutex*);
|
^
|
/home/ol11/Projects/ship_software/sw/fedora28_x86-64/ROOT/master-1/include/TMCAutoLock.h:99:15: note: previous definition is here
|
typedef int (*thread_unlock)(TMCMutex *);
|
^
|