#51 closed defect (fixed)
Compiling with gcc 4.4 fails
Reported by: | Generic User (don't modify these fields) | Owned by: | support@sherpa-mc.de |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Unknown | Version: | 1.2.0 |
Keywords: | Cc: | p.weitershausen@physics.gla.ac.uk |
Description
Sherpa 1.2.0 fails to compile with gcc 4.4:
In file included from Soft_Cluster_Handler.C:1: ../../AHADIC++/Tools/Soft_Cluster_Handler.H:59: error: declaration of 'double AHADIC::Soft_Cluster_Handler::DecayWeight(AHADIC::Cluster*, ATOOLS::Flavour&, ATOOLS::Flavour&, const bool&)' ../../AHADIC++/Tools/Soft_Cluster_Handler.H:21: error: changes meaning of 'DecayWeight' from 'struct AHADIC::DecayWeight'
The reason for this is the repeated definition of the DecayWeight
name (line 21 and 59). It creates an ambiguity that's apparently not allowed by the C++ standard but has been tolerated by gcc so far. As of gcc 4.3 this is not tolerated anymore, hence the above error. For more information see for instance http://stupefydeveloper.blogspot.com/2008/11/c-name-lookup-changes-in-g-43.html (it also links to the gcc 4.3 release notes).
A workaround is to compile with the -fpermissive
flag. This changes the error to a warning. In other words, setting export CXXFLAGS=-fpermissive
before running configure
fixes the problem for now. I suggest adding this to the Patches/known problems/known bugs/FAQs section of the website until the code is fixed and a version containing the bugfix is released.
Note: make
stops after the first error, so there might be more instances of this problem lurking in other bits of the code.
Attachments (0)
Change History (4)
comment:1 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 15 years ago by
Thanks for the quick fix, Marek! I've now found the time to recompile with your patch and can confirm that it works well. Cheers, Philipp.
comment:3 Changed 13 years ago by
Milestone: | → rel-old |
---|
Hi Philipp, thanks for reporting this issue. There was indeed an ambiguity in the naming of a class and a member of another class in the same namespace. We only tested the new release with gcc up to 4.3.3 where this issue did not pose a problem. Nonetheless, this issue will resolve by applying the respective patch provided on the download page and Sherpa now properly compiles with gcc 4.4.1. Hope this helps. If you come across any other problem with the code, please do not hesitate to ask. Cheers,
Marek