Boost logo

Boost :

Subject: Re: [boost] Spirit V1.8 to V2.1 Porting Errors
From: Alireza Bemanian (bemanian_at_[hidden])
Date: 2010-02-25 12:39:13


Hi,

Yes, these are the compilation errors.

2>------ Build started: Project: Project, Configuration: Debug Win32 ------
2> ProjectFRM.cpp
2>F:Project\boost\boost/detail/interlocked.hpp(57): error C2373:
'_InterlockedIncrement' : redefinition; different type modifiers
2> G:\Program Files\Microsoft Visual Studio
10.0\VC\include\intrin.h(177) : see declaration of '_InterlockedIncrement'
2>F:Project\boost\boost/detail/interlocked.hpp(58): error C2373:
'_InterlockedDecrement' : redefinition; different type modifiers
2> G:\Program Files\Microsoft Visual Studio
10.0\VC\include\intrin.h(175) : see declaration of '_InterlockedDecrement'
2>F:Project\boost\boost/detail/interlocked.hpp(59): error C2373:
'_InterlockedCompareExchange' : redefinition; different type modifiers
2> G:\Program Files\Microsoft Visual Studio
10.0\VC\include\intrin.h(176) : see declaration of
'_InterlockedCompareExchange'
2>F:Project\boost\boost/smart_ptr/detail/sp_counted_base_w32.hpp(73): error
C3861: '_InterlockedIncrement': identifier not found
2>F:Project\boost\boost/smart_ptr/detail/sp_counted_base_w32.hpp(92): error
C2446: '==' : no conversion from 'long' to 'long (__clrcall *)(volatile long
*,long,long)'
2>F:Project\boost\boost/smart_ptr/detail/sp_counted_base_w32.hpp(92): error
C2040: '==' : 'long (__clrcall *)(volatile long *,long,long)' differs in
levels of indirection from 'long'
2>F:Project\boost\boost/smart_ptr/detail/sp_counted_base_w32.hpp(92): error
C3861: '_InterlockedCompareExchange': identifier not found
2>F:Project\boost\boost/smart_ptr/detail/sp_counted_base_w32.hpp(100): error
C3861: '_InterlockedDecrement': identifier not found
2>F:Project\boost\boost/smart_ptr/detail/sp_counted_base_w32.hpp(109): error
C3861: '_InterlockedIncrement': identifier not found
2>F:Project\boost\boost/smart_ptr/detail/sp_counted_base_w32.hpp(114): error
C3861: '_InterlockedDecrement': identifier not found
2>CL : warning : This header is deprecated. Please use:
boost/spirit/include/classic_ast.hpp
2>CL : warning : This header is deprecated. Please use:
boost/spirit/include/classic_tree_to_xml.hpp
2> CThreads.cpp

I tried to use the Spirit Classic by changing the project include and
namespace statements to classic. Those are the only changes made to the
project for the port. The library is stored as the complete download with
the rest of the boost libraries including the smart pointer, and have not
further tried to compile the code with removing such directories.

Best Regards,
Reza Bemanian

-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
On Behalf Of Hartmut Kaiser
Sent: Thursday, February 25, 2010 10:19 AM
To: boost_at_[hidden]
Subject: Re: [boost] Spirit V1.8 to V2.1 Porting Errors

> Trying to port the code to V2.1, a number of redefinition errors get
> generated by the compiler. The first instance is the extern
> InterLockedIncrement variable at line 73 of the interlocked.hpp file.
> The
> code is segmented for different platforms using #if #elif and so on
> directives. The project is at the same time ported from Visual Studio
> 2008
> to 2010 RC1, and the redefinition error is caused by compiler not
> excluding
> parts of that file. The define by the Visual Studio is the _WIN32_WINNT
> base
> on the use of the 32 bit development PC. This definition is not listed
> by
> the #elif chain within the interlocked.hpp code and it seems that
> BOOST_USE_WINDOWS_H is used instead. Knowing the segments are coded to
> be
> mutually exclusive, still the code generates errors?

I doubt this has anything to do with Spirit as it doesn't make any use of
InterLockedIncrement. AFAIR it doesn't even (directly) include windows.h.

Please provide a minimal example exposing your problem, otherwise it's
almost impossible to help.

Regards Hartmut

---------------
Meet me at BoostCon
www.boostcon.com

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk