New trouble compiling with MS VC6 SP5 and MFC/AFX
Hi, if I want use the boost libs in an existing MFC/AFX environment I have a lot of compiling problems, what seems to depend on the order of includes. One problem what I see, but I don't understand, is the following compile error: Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. cl /MDd /W3 /GR /GX /Zi /Od /I ...bunch of includes... /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_SECDLL" /D "_AFXDLL" /D "_ MBCS" /D "_GXDLL" /D "NOMINMAX" /D "_SECNOMSG" /D "_GXNOMSG" /D "_SFLNOMSG" /Fp" D:\temp\debug\GUIClient/Plato.pch" /YX"stdafx.h" /Fo"D:\temp\debug\GUIClient/" / Fd"D:\temp\debug\GUIClient/" /FD /Zm200 /GZ /c "F:\Gui+Client\src\AboutDlg.cpp" AboutDlg.cpp Note: Using precompiled header Automatically linking with RWUXThemeSD.lib ..\..\PlatoServer\Basics\boost\inc\boost/detail/iterator.hpp(326) : error C2039: 'difference_type' : is not a member of 'Iterator' ..\..\..\libs\stingray\objective_studio\include\foundation\Patterns\Iter ator.h(77) : see declaration of 'Iterator' ..\..\PlatoServer\Basics\boost\inc\boost/detail/iterator.hpp(331) : see reference to class template instantiation 'boost::detail::standard_iterator_traits<Iterator>' being compiled ... So it looks like, that the template parameter "Iterator" in "boost::detail::standard_iterator_traits<Iterator>" conflicts with the template class "stingray::foundation::Iterator" in some header files from the GUI control stuff, what was included before the boost header. How is this possible, what has the template parameter "Iterator" in the namespace "boost::detail" to do with the template class "Iterator" in the namespace "stingray::foundation" has anybody an explaination for this? regards Arno
Hi,
if I want use the boost libs in an existing MFC/AFX environment I have a lot of compiling problems, what seems to depend on the order of includes. One
"Arno Schäfer"
what I see, but I don't understand, is the following compile error:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. cl /MDd /W3 /GR /GX /Zi /Od /I ...bunch of includes... /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_SECDLL" /D "_AFXDLL" /D "_ MBCS" /D "_GXDLL" /D "NOMINMAX" /D "_SECNOMSG" /D "_GXNOMSG" /D "_SFLNOMSG" /Fp" D:\temp\debug\GUIClient/Plato.pch" /YX"stdafx.h" /Fo"D:\temp\debug\GUIClient/" / Fd"D:\temp\debug\GUIClient/" /FD /Zm200 /GZ /c "F:\Gui+Client\src\AboutDlg.cpp" AboutDlg.cpp Note: Using precompiled header Automatically linking with RWUXThemeSD.lib ..\..\PlatoServer\Basics\boost\inc\boost/detail/iterator.hpp(326) : error C2039: 'difference_type' : is not a member of 'Iterator'
ator.h(77) : see declaration of 'Iterator' ..\..\PlatoServer\Basics\boost\inc\boost/detail/iterator.hpp(331) : see reference to class template instantiation 'boost::detail::standard_iterator_traits<Iterator>' being compiled ...
So it looks like, that the template parameter "Iterator" in "boost::detail::standard_iterator_traits<Iterator>" conflicts with the template class "stingray::foundation::Iterator" in some header files from
..\..\..\libs\stingray\objective_studio\include\foundation\Patterns\Iter the
GUI control stuff, what was included before the boost header. How is this possible, what has the template parameter "Iterator" in the namespace "boost::detail" to do with the template class "Iterator" in the namespace "stingray::foundation" has anybody an explaination for this?
My guess is that if you read the error message literally, it's telling you
that somewhere in _your_ code you are (indirectly?) trying to instantiate a
boost::standard_iterator_traits struct using a RogueWave Iterator. The
RogueWave iterator is _not_ a standard conforming iterator. It does not have
the requisite typedefs as shown below:
template <typename _Elem>
class IteratorBase
{
public:
typedef _Elem Element;
virtual ~IteratorBase() {}
public:
virtual Element Next() = 0;
virtual Element Prev() = 0;
virtual Element Current() = 0;
virtual bool Finished() = 0;
virtual void Start() = 0;
};
template
Jeff Flinn
I've inherited a couple of MFC projects using both Roguewave and boost extensively without "conflict".
Hi Jeff, I eliminate my problem through including the stuff who contain the boost header before the stuff which include the roguewave header. If you have done this so often, have you some hints for me, how I can prevent me from trouble? I have often a problem to use the dinkumware stuff with Roguewave. Are there some rules, which compiler defines and perhaps which ordering of usage helps to eliminate problems? Many thanks in advance Arno
"Jeff Flinn"
RogueWave iterator is _not_ a standard conforming iterator. It does not have the requisite typedefs as shown below:
Standard iterators are not required to have nested typedefs. You can adapt other iterator-like types by specializing std::iterator_traits. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (3)
-
Arno Schäfer
-
David Abrahams
-
Jeff Flinn