PDA

View Full Version : Visual Studio 2002 ClanLib 0.9 Compile Error



rombust
10-21-2008, 08:52 AM
The latest ClanLib 0.9 in the SVN will not compile on Visual Studio 2002 (v7.0.9955)



opengl.cpp
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xmemory(87) : error C2535: 'std::allocator<_Ty>::pointer std::allocator<_Ty>::address(std::allocator<_Ty>::reference) const' : member function already defined or declared
with
[
_Ty=const std::_Tree<std::_Tmap_traits<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *,std::less<const CL_OpenGLGraphicContextProvider *const >,std::allocator<std::pair<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *>>,false>>::key_type
]
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xmemory(81) : see declaration of 'std::allocator<_Ty>::address'
with
[
_Ty=const std::_Tree<std::_Tmap_traits<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *,std::less<const CL_OpenGLGraphicContextProvider *const >,std::allocator<std::pair<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *>>,false>>::key_type
]
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xtree(122) : see reference to class template instantiation 'std::allocator<_Ty>' being compiled
with
[
_Ty=const std::_Tree<std::_Tmap_traits<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *,std::less<const CL_OpenGLGraphicContextProvider *const >,std::allocator<std::pair<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *>>,false>>::key_type
]
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\map(77) : see reference to class template instantiation 'std::_Tree<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *,std::less<const CL_OpenGLGraphicContextProvider *const >,std::allocator<std::pair<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *>>,false>
]
GL\OPENGL.CPP(492) : see reference to class template instantiation 'std::map<_Kty,_Ty,_Pr,_Alloc>' being compiled
with
[
_Kty=const CL_OpenGLGraphicContextProvider *const ,
_Ty=CL_GLFunctions *,
_Pr=std::less<const CL_OpenGLGraphicContextProvider *const >,
_Alloc=std::allocator<std::pair<const CL_OpenGLGraphicContextProvider *const ,CL_GLFunctions *>>
]

In GL/opengl.cpp, If i change the line:


typedef std::map<const CL_OpenGLGraphicContextProvider * const, CL_GLFunctions *> cl_function_map_type;

And remove the second "const"
To give:


typedef std::map<const CL_OpenGLGraphicContextProvider *, CL_GLFunctions *> cl_function_map_type;

It compiles.

Is this a bug with clanlib or the compiler?

rombust
10-22-2008, 12:43 PM
I added the following patch:

+
+// A fix for a compiler bug with compiler version 13.00.9466
+#if _MSC_VER > 1300
typedef std::map<const CL_OpenGLGraphicContextProvider * const, CL_GLFunctions *> cl_function_map_type;
+#else
+typedef std::map<const CL_OpenGLGraphicContextProvider *, CL_GLFunctions *> cl_function_map_type;
+#endif
+

alexv1
06-10-2009, 02:17 PM
@%$mmbf ... I'm going to shoot myself :crazy: