Hi,
I'm trying to instanciate TGWidgetElement with a std::vector, which derives
from osg::geode with a std::vector but it gives following errors.
--------------------------------------------------------------
Compiler Output:
In file included from /usr/include/osg/Group:17,
from TGBaseWidget.hpp:11,
from TGBaseWidget.cpp:1:
/usr/include/osg/Node:60: instantiated from ‘void std::vector<_Tp,
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, const _Tp&) [with _Tp = TGWidgetElement, _Alloc =
std::allocator<TGWidgetElement>]’
/usr/include/c++/4.4/bits/stl_vector.h:741: instantiated from ‘void
std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = TGWidgetElement,
_Alloc = std::allocator<TGWidgetElement>]’
TGBaseWidget.cpp:64: instantiated from here
/usr/include/osg/Object:169: error: ‘osg::Object& osg::Object::operator=(const
osg::Object&)’ is private
/usr/include/osg/Node:60: error: within this context
/usr/include/osg/Geode: In member function ‘osg::Geode&
osg::Geode::operator=(const osg::Geode&)’:
In file included from /usr/include/osgDB/SharedStateManager:19,
from /usr/include/osgDB/DatabasePager:29,
from /usr/include/osgDB/Registry:26,
from /usr/include/osgDB/ReadFile:24,
from TGWidgetElement.hpp:15,
from TGBaseWidget.hpp:12,
from TGBaseWidget.cpp:1:
/usr/include/osg/Geode:29: instantiated from ‘void std::vector<_Tp,
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, const _Tp&) [with _Tp = TGWidgetElement, _Alloc =
std::allocator<TGWidgetElement>]’
/usr/include/c++/4.4/bits/stl_vector.h:741: instantiated from ‘void
std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = TGWidgetElement,
_Alloc = std::allocator<TGWidgetElement>]’
TGBaseWidget.cpp:64: instantiated from here
/usr/include/osg/Geode:29: note: synthesized method ‘osg::Node&
osg::Node::operator=(const osg::Node&)’ first required here
TGWidgetElement.hpp: In member function ‘TGWidgetElement&
TGWidgetElement::operator=(const TGWidgetElement&)’:
In file included from TGBaseWidget.hpp:12,
from TGBaseWidget.cpp:1:
TGWidgetElement.hpp:19: instantiated from ‘void std::vector<_Tp,
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, const _Tp&) [with _Tp = TGWidgetElement, _Alloc =
std::allocator<TGWidgetElement>]’
/usr/include/c++/4.4/bits/stl_vector.h:741: instantiated from ‘void
std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = TGWidgetElement,
_Alloc = std::allocator<TGWidgetElement>]’
TGBaseWidget.cpp:64: instantiated from here
TGWidgetElement.hpp:19: note: synthesized method ‘osg::Geode&
osg::Geode::operator=(const osg::Geode&)’ first required here
/usr/include/c++/4.4/bits/vector.tcc: In member function ‘void std::vector<_Tp,
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, const _Tp&) [with _Tp = TGWidgetElement, _Alloc =
std::allocator<TGWidgetElement>]’:
In file included from /usr/include/c++/4.4/vector:69,
from /usr/include/osg/StateAttribute:23,
from /usr/include/osg/StateSet:18,
from /usr/include/osg/Node:19,
from /usr/include/osg/Group:17,
from TGBaseWidget.hpp:11,
from TGBaseWidget.cpp:1:
/usr/include/c++/4.4/bits/vector.tcc:312: note: synthesized method
‘TGWidgetElement& TGWidgetElement::operator=(const TGWidgetElement&)’ first
required here
make[2]: *** [build/Release/GNU-Linux-x86/TGBaseWidget.o] Fehler 1
make[2]: Verlasse Verzeichnis
'/home/thorsten/NetBeansProjects/thyrgon~subversion/Thyrgon'
make[1]: *** [.build-conf] Fehler 2
make[1]: Verlasse Verzeichnis
'/home/thorsten/NetBeansProjects/thyrgon~subversion/Thyrgon'
make: *** [.build-impl] Fehler 2
-------------------------------------------------------
The Code:
int posX = 585;
int posY = 370;
std::vector<TGWidgetElement> ElementLower;
for(int i=count_width; i>0; i--)
{
ElementLower.push_back(TGWidgetElement(posX, posY,
"WidgElementSideLower.png"));
posX += 15;
posY += 15;
//this->addChild(ElementLower[count_width]);
}
I'm really stuck here. What am i doing wrong???
Thank you!
Cheers,
Thorsten
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=19491#19491
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org