Hi Jesper,
error C2079: 'asg::ASGContainer::m_osgroot' uses undefined class
'osg::ref_ptr<T>'
Template classes/methods need to be completely defined when they are
used, so what you're trying won't work.
In addition to using the pimpl idiom which would completely solve your
problem but might take some time to implement everywhere it would be
needed, you could get by just including <osg/ref_ptr> and forward
declaring the classes that will be contained in a ref_ptr. So instead of:
namespace osg
{
class Node;
class Material;
template <typename T> class ref_ptr;
};
you could do:
#include <osg/ref_ptr>
namespace osg
{
class Node;
class Material;
};
The ref_ptr header is small and if that is the only one included in most
places then you've got 98% of what you wanted for much less effort than
using pimpl everywhere. That said, if I were designing an OSG-based API
today I would probably use pimpl from the start and keep my public
interface independent of OSG as much as I can. But that's just a design
preference, and when refactoring existing code the decisions are
different...
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org