nodepath.cpp compile failure with gcc3 - more info
Hello, I did more digging into the gcc3 compile failure in nodepath.cpp and I think I found the source of the problem.
nodepath.cpp includes 2geom/path.h (via live_effects/effect.h via live_effects/lpeobject.h) which defines the class Path in the namespace Geom. livarot/livarot-forward.h declares 'class Path', without a namespace. This seems to cause gcc3 confusion.
Possibly this is the problem mentioned in the comment in nodepath.cpp: "/// evil evil evil. FIXME: conflict of two different Path classes!" ?
Has anyone thought about a fix to this before? It seems like a possible solution would be to add a namespace around the Path class in livarot or to rename one of the classes, but I'm not sure what the ripple effect would be. I tried adding "Geom::" or "::" to Path in a couple places, but it didn't seem to work.
Thanks, John
On 10/13/07, John Faith <jfaith7@...400...> wrote:
Possibly this is the problem mentioned in the comment in nodepath.cpp: "/// evil evil evil. FIXME: conflict of two different Path classes!" ?
It's even funnier than that. That comment refers to yet another Path class. So the one in Geom is actually the third one, not second :)
- Path in nodepath.cpp
- Path in livarot
- Path in Geom
Has anyone thought about a fix to this before? It seems like a possible solution would be to add a namespace around the Path class in livarot or to rename one of the classes, but I'm not sure what the ripple effect would be. I tried adding "Geom::" or "::" to Path in a couple places, but it didn't seem to work.
I think we just need to add a namespace for the nodepath Path, because that will leave only the livarot one without namespace. Try to avoid touching livarot (because it's ugly and will hopefully be eliminated one day) and Geom (because it's actually a copy of code from another project, with periodic syncing); this leaves the nodepath Path. Please try this and if it works, submit a patch.
Hello,
On 10/13/07, bulia byak <buliabyak@...400...> wrote:
On 10/13/07, John Faith <jfaith7@...400...> wrote:
Possibly this is the problem mentioned in the comment in nodepath.cpp: "/// evil evil evil. FIXME: conflict of two different Path classes!" ?
It's even funnier than that. That comment refers to yet another Path class. So the one in Geom is actually the third one, not second :)
Path in nodepath.cpp
Path in livarot
Path in Geom
I see. That is funny, in a sad kind of way.
Has anyone thought about a fix to this before? It seems like a possible solution would be to add a namespace around the Path class in livarot or to rename one of the classes, but I'm not sure what the ripple effect would be. I tried adding "Geom::" or "::" to Path in a couple places, but it didn't seem to work.
I think we just need to add a namespace for the nodepath Path, because that will leave only the livarot one without namespace. Try to avoid touching livarot (because it's ugly and will hopefully be eliminated one day) and Geom (because it's actually a copy of code from another project, with periodic syncing); this leaves the nodepath Path. Please try this and if it works, submit a patch.
In nodepath.h, the 'class Path' definition is already inside: namespace Inkscape { namespace NodePath {
, so where were you thinking that the nodepath namespace be added? There seem to be separate namespaces already for these 3 classes, and since this is not a compile problem in gcc4, I assume that this is a gcc3-only bug which needs a workaround.
- nodepath.cpp: Inkscape::NodePath::Path - livarot: ::Path - 2geom: Geom::Path
Thanks, John
On 10/13/07, John Faith <jfaith7@...400...> wrote:
, so where were you thinking that the nodepath namespace be added? There seem to be separate namespaces already for these 3 classes, and since this is not a compile problem in gcc4, I assume that this is a gcc3-only bug which needs a workaround.
Hmm, indeed. So, try to find out what's wrong and submit a patch anyway :)
participants (2)
-
bulia byak
-
John Faith