Boost logo

Boost Users :

Subject: [Boost-users] Issues with unnamed enums
From: Kyle Altendorf (kyle.altendorf_at_[hidden])
Date: 2010-01-27 12:37:28


I have just tried to use Boost for the first time and it appears to
not take kindly to unnamed enums from another library I use and (once
those were named) some Microsoft SDK. I am using:

Windows XP SP3
Visual Studio 2008 SP1
Boost 1.41.0

More specifically, after adding '#include <boost/foreach.hpp>' I
started getting compilation errors such as:

1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43) :
error C2332: 'class' : missing tag name
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43) :
error C2011: '<unnamed-tag>' : 'enum' type redefinition
1> c:\korvis\korvislibs\khmilib\kvdisplay.h(18) : see
declaration of '<unnamed-tag>'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43) :
error C2143: syntax error : missing ',' before 'constant'

kvdisplay.h(18) is the definition of an unnamed enum in another
library I use. iterator_facade.hpp(43) is (including comments before
it):

> // This forward declaration is required for the friend declaration
> // in iterator_core_access
> template <class I, class V, class TC, class R, class D> class iterator_facade;

I went through and named a each of the unnamed enums as the compiler
referenced them until I got to an issue with shlwapi.h from a
Microsoft SDK. Here's the complete compiler error list at that point:

1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43) :
error C2332: 'class' : missing tag name
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43) :
error C2011: '<unnamed-tag>' : 'enum' type redefinition
1> c:\program files\microsoft
sdks\windows\v6.0a\include\shlwapi.h(1550) : see declaration of
'<unnamed-tag>'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43) :
error C2143: syntax error : missing ',' before 'constant'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(479) :
error C2332: 'class' : missing tag name
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(479) :
error C2011: '<unnamed-tag>' : 'enum' type redefinition
1> c:\program files\microsoft
sdks\windows\v6.0a\include\shlwapi.h(1550) : see declaration of
'<unnamed-tag>'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(479) :
error C2143: syntax error : missing ',' before 'constant'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(484) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(484) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(485) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(485) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(487) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(487) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(488) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(488) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(489) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(489) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(490) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(490) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(494) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(494) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(501) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(508) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(43)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(566) :
error C2332: 'class' : missing tag name
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(566) :
error C2011: '<unnamed-tag>' : 'enum' type redefinition
1> c:\program files\microsoft
sdks\windows\v6.0a\include\shlwapi.h(1550) : see declaration of
'<unnamed-tag>'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(566) :
error C2143: syntax error : missing ',' before 'constant'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(567) :
error C2988: unrecognizable template declaration/definition
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(567) :
error C2059: syntax error : 'constant'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(567) :
error C2065: 'V' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(567) :
error C2065: 'TC' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(567) :
error C2065: 'R' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(567) :
error C2065: 'D' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(572) :
error C2332: 'class' : missing tag name
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(572) :
error C2011: '<unnamed-tag>' : 'enum' type redefinition
1> c:\program files\microsoft
sdks\windows\v6.0a\include\shlwapi.h(1550) : see declaration of
'<unnamed-tag>'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(573) :
error C2065: 'V' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(573) :
error C2065: 'TC' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(573) :
error C2065: 'R' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(573) :
error C2065: 'D' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(574) :
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(721) :
error C3855: 'boost::iterator_facade': template parameter '__formal'
is incompatible with the declaration
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(721) :
error C2977: 'boost::iterator_facade' : too many template arguments
1> c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(601)
: see declaration of 'boost::iterator_facade'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(724) :
error C2332: 'class' : missing tag name
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(724) :
error C2011: '<unnamed-tag>' : 'enum' type redefinition
1> c:\program files\microsoft
sdks\windows\v6.0a\include\shlwapi.h(1550) : see declaration of
'<unnamed-tag>'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(724) :
error C2143: syntax error : missing ',' before 'constant'
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(725) :
error C2065: 'V' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(725) :
error C2065: 'R' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(725) :
error C2065: 'TC' : undeclared identifier
1>c:\korvis\boost\include\boost\iterator\iterator_facade.hpp(726) :
fatal error C1903: unable to recover from previous error(s); stopping
compilation

Am I correct that the unnamed enums are somehow causing the problem?
Any help you can offer understanding or resolving this issue would be
greatly appreciated.

Thanks for your time,
-kyle


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net