Hello Sajjadul,
Sajjadul Islam wrote:
> it is about one of the topics shown in the tutorial section 4.10.2
>
> i tried to compile the code within the tutorial that came along with
> the OpenSG source
>
> ~/downloads/OpenSG/OpenSG/Doc/tutorial/progs/examples$
>
>
> but when i try to compile i get the following error:
>
> 00coredPointer.cpp: In function 'osg::NodePtr createScenegraph()':
> 00coredPointer.cpp:22: error: reference to 'GeometryNodePtr' is ambiguous
> 00coredPointer.cpp:18: error: candidates are: typedef class
> osg::CoredNodePtr<osg::Geometry> GeometryNodePtr
> /usr/local/include/OpenSG/OSGGeometryBase.h:447: error:
> typedef class osg::CoredNodePtr<osg::Geometry> osg::GeometryNodePtr
> 00coredPointer.cpp:22: error: reference to 'GeometryNodePtr' is ambiguous
> 00coredPointer.cpp:18: error: candidates are: typedef class
> osg::CoredNodePtr<osg::Geometry> GeometryNodePtr
> /usr/local/include/OpenSG/OSGGeometryBase.h:447: error:
> typedef class osg::CoredNodePtr<osg::Geometry> osg::GeometryNodePtr
> 00coredPointer.cpp:22: error: expected `;' before 'torus'
> 00coredPointer.cpp:23: error: 'torus' was not declared in this scope
> 00coredPointer.cpp:26: error: reference to 'GeometryNodePtr' is ambiguous
> 00coredPointer.cpp:18: error: candidates are: typedef class
> osg::CoredNodePtr<osg::Geometry> GeometryNodePtr
> /usr/local/include/OpenSG/OSGGeometryBase.h:447: error:
> typedef class osg::CoredNodePtr<osg::Geometry> osg::GeometryNodePtr
> 00coredPointer.cpp:26: error: reference to 'GeometryNodePtr' is ambiguous
> 00coredPointer.cpp:18: error: candidates are: typedef class
> osg::CoredNodePtr<osg::Geometry> GeometryNodePtr
> /usr/local/include/OpenSG/OSGGeometryBase.h:447: error:
> typedef class osg::CoredNodePtr<osg::Geometry> osg::GeometryNodePtr
> 00coredPointer.cpp:26: error: expected `;' before 'box'
> 00coredPointer.cpp:27: error: 'box' was not declared in this scope
> 00coredPointer.cpp:30: error: reference to 'GroupNodePtr' is ambiguous
> 00coredPointer.cpp:17: error: candidates are: typedef class
> osg::CoredNodePtr<osg::Group> GroupNodePtr
> /usr/local/include/OpenSG/OSGGroupBase.h:216: error:
> typedef class osg::CoredNodePtr<osg::Group> osg::GroupNodePtr
> 00coredPointer.cpp:30: error: reference to 'GroupNodePtr' is ambiguous
> 00coredPointer.cpp:17: error: candidates are: typedef class
> osg::CoredNodePtr<osg::Group> GroupNodePtr
> /usr/local/include/OpenSG/OSGGroupBase.h:216: error:
> typedef class osg::CoredNodePtr<osg::Group> osg::GroupNodePtr
> 00coredPointer.cpp:30: error: expected `;' before 'root'
> 00coredPointer.cpp:31: error: 'root' was not declared in this scope
> make: *** [00coredPointer] Error 1
>
> I am not sure why this error pops up, because it is resolved by
> specifying OSG_USING_NAMESPACE
hm, I don't understand this last sentence, the file
OpenSG/Doc/tutorial/progs/examples/00coredPointer.cpp has a
OSG_USING_NAMESPACE.
The error, however, is the two typedefs on lines 17-18:
typedef CoredNodePtr<Group> GroupNodePtr;
typedef CoredNodePtr<Geometry> GeometryNodePtr;
they declare these types in the global namespace, not in the OSG
namespace. When this code was written these types where not
automatically declared for all field containers, but since that is the
case now, with the above there are now two GroupNodePtr declared, one in
namespace OSG one in the global namespace and with the
OSG_USING_NAMESPACE an unqualified reference to one of these becomes
ambiguous.
So the fix is to remove the typedefs, I'll fix that in a minute and have
a look at the tutorial pages, if they contain copies of that code.
Thanks for reporting the issue,
Carsten
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users