Hi Jeremy

On Tue, May 13, 2008 at 6:16 PM, Jeremy Moles <[EMAIL PROTECTED]> wrote:
>
>
>  On Tue, 2008-05-13 at 17:49 +0200, Thibault Genessay wrote:
>  > Hi Jeremy
>  >
>  > I've just tried to compile your code using Visual Studio 9.0 and got
>  > lots of errors that are almost all related to 'const' usage. I am
>  > sometime suspicious about Redmond compilers so I also tried to compile
>  > the code on Debian 4.0, and the errors are (hopefully) similar.
>  >
>  > Here is the output from the Linux build:
>  >
>  > [EMAIL PROTECTED]:~/prog/osgWidget-0.1.8$ make
>  > Scanning dependencies of target osgWidget
>  > [  2%] Building CXX object CMakeFiles/osgWidget.dir/src/Box.o
>  > [  5%] Building CXX object CMakeFiles/osgWidget.dir/src/Canvas.o
>  > [  8%] Building CXX object CMakeFiles/osgWidget.dir/src/Frame.o
>  > /home/tibo/prog/osgWidget-0.1.8/include/osgWidget/UIObjectParent: In
>  > member function 'T* osgWidget::UIObjectParent<T>::_getByName(const
>  > std::string&) const [with T = osgWidget::Widget]':
>  > /home/tibo/prog/osgWidget-0.1.8/include/osgWidget/UIObjectParent:76:
>  > instantiated from 'const T*
>  > osgWidget::UIObjectParent<T>::getByName(const std::string&) const
>  > [with T = osgWidget::Widget]'
>  > /home/tibo/prog/osgWidget-0.1.8/src/Frame.cpp:109:   instantiated from here
>  > /home/tibo/prog/osgWidget-0.1.8/include/osgWidget/UIObjectParent:56:
>  > error: invalid conversion from 'const osgWidget::Widget*' to
>  > 'osgWidget::Widget*'
>  > make[2]: *** [CMakeFiles/osgWidget.dir/src/Frame.o] Error 1
>  > make[1]: *** [CMakeFiles/osgWidget.dir/all] Error 2
>  > make: *** [all] Error 2
>
>  I'd be real interested to know what version of GCC is complaining about
>  this. I don't see this error on Fedora 8/GCC4.1, and I've never had an
>  e-mail about it or antyhing. The code, as far as I can tell, is
>  perfectly valid C++. Perhaps I can come up with a workaround for this,
>  as I really do believe it's valid C++...
>
>
>  > And Windows build:
>  >
>  > 3>------ Build started: Project: osgWidget, Configuration: Debug Win32 
> ------
>  > 3>Compiling...
>  > 3>WindowManager.cpp
>  > 3>.\src\WindowManager.cpp(191) : error C2440: 'initializing' : cannot
>  > convert from 'const osgWidget::Window *' to 'osgWidget::Window *'
>  > 3>        Conversion loses qualifiers
>  > 3>.\src\WindowManager.cpp(203) : error C2440: 'initializing' : cannot
>  > convert from 'const osgWidget::Widget *' to 'osgWidget::Widget *'
>  > 3>        Conversion loses qualifiers
>  > 3>.\src\WindowManager.cpp(333) : error C2440: 'initializing' : cannot
>  > convert from 'const osgWidget::Window *' to 'osgWidget::Window *'
>  > 3>        Conversion loses qualifiers
>  > [...]
>
>  This is the exact same problem as above. I can definitely come up with a
>  workaround, but if possible I'd like to see your version of GCC first if
>  possible. :)
>

Strange ... I have 4.1 as well:
[EMAIL PROTECTED]:~$ g++ --version
g++ (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

However, on the C++ side, I feel that there is a problem somewhere. At
line 191 of WindowManager.cpp, you write

Window* parent = wl->back()->getParent(); // wl is declared as 'const
WidgetList* wl'

Which does not seem valid to me. wl is a const list that holds const
pointers, which can't be casted to non-const Window*. I have tried to
replace line 191 by
const Window* parent = ...
under Visual C++ and the error for that line went away.

As far as I have looked in the sources to find the errors, both
compilers seemed to be right. The fact that two completely different
environments (XP SP2 + VC 9 + CMake 2.5, Debian 4 + GCC 4.1.2 + CMake
2.6) give the same errors do not look like a coincidence.

But ... I'm really puzzled by this because I had successfully compiled
osgWidgets-0.17 previously and I doubt all of these errors were
introduced in the meantime.

Regards

Thibault

>
>
>  > Thibault
>  >
>  > On Tue, May 13, 2008 at 5:03 PM, Jeremy Moles <[EMAIL PROTECTED]> wrote:
>  > > I've put the (hopefully!) final version of a separate osgWidget up on
>  > >  the googlecode site:
>  > >
>  > >         http://osgwidget.googlecode.com
>  > >
>  > >  This means that I feel like I'm getting closer to the point where it
>  > >  would make sense to submit osgWidget to Robert to see how he feels about
>  > >  inclusion into the main trunk, with ongoing development there instead.
>  > >  This will expose far more eyeballs to osgWidget's codebase, which can
>  > >  only be good as development continues.
>  > >
>  > >  The next version (I'll call 0.2.0 for now) will be the one I submit, and
>  > >  I'm going to construct a serious TODO list of items on the website
>  > >  project page of things I want to accomplish prior to this. I can't say
>  > >  how long this will take, but hopefully no longer than about two weeks or
>  > >  so...
>  > >
>  > >  This also means I'll probably make a few posts within the next two weeks
>  > >  asking questions regarding some outstanding issues, soliciting design
>  > >  opinions, etc. I only even mention this so that folks don't think I'm
>  > >  spamming the lists. :)
>  > >
>  > >  Keep in mind that even if Robert is feeling brave enough to allow this
>  > >  code to sneak in, it won't nearly be "feature complete." The goal,
>  > >  however, isn't to provide a final version but to expose more people and
>  > >  hopefully expose more bugs/flaws.
>  > >
>  > >  _______________________________________________
>  > >  osg-users mailing list
>  > >  osg-users@lists.openscenegraph.org
>  > >  
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>  > >
>  >
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to