Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem building boost\optional\optional.hpp in VS2010
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-08-05 16:04:01


> Hi,
>
> We've been using boost v1.36 in Visual Studio 2005 for a few years now. I'm attempting to upgrade our projects & solutions to build in Visual Studio 2010 & thus I've upgraded to boost 1.47.0. However I'm getting an error when trying to compile a project which uses some boost functions
>
> Full text of the error message is as follows:
>
> 1> ASIMNET.CPP
> 1>c:\code\inc\boost\optional\optional.hpp(346): error C2061: syntax error : identifier 'm_storage'
> 1> c:\code\inc\boost\optional\optional.hpp(345) : while compiling class template member function 'void boost::optional_detail::optional_base<T>::construct(const std::locale &)'
> 1> with
> 1> [
> 1> T=boost::io::detail::locale_t
> 1> ]
> 1> c:\code\inc\boost\optional\optional.hpp(500) : see reference to class template instantiation 'boost::optional_detail::optional_base<T>' being compiled
> 1> with
> 1> [
> 1> T=boost::io::detail::locale_t
> 1> ]
> 1> c:\code\inc\boost\format\internals.hpp(56) : see reference to class template instantiation 'boost::optional<T>' being compiled
> 1> with
> 1> [
> 1> T=boost::io::detail::locale_t
> 1> ]
> 1> c:\code\inc\boost\format\internals.hpp(57) : see reference to class template instantiation 'boost::io::detail::stream_format_state<Ch,Tr>' being compiled
> 1>
> 1>Build FAILED.
> 1>
>
> The only references to boost in ASIMNET.CPP are as follows:
>
> #include <boost/math/special_functions/round.hpp>
>
> translation[X] = boost::math::round( (translation[X]/TILEWIDTH) ) * TILEWIDTH;
> translation[Y] = boost::math::round( (translation[Y]/TILEWIDTH) ) * TILEWIDTH;
>
> Any help will be most appreciated.

The following compiles fine for me with MSVC10 and boost 1.47.0:

#include <boost/math/special_functions/round.hpp>
 
const int TILEWIDTH = 5;
const int X = 0;
const int Y = 1;
 
double translation[2] = {1.0, 1.0};
 
int main()
{
    translation[X] = boost::math::round( (translation[X]/TILEWIDTH) ) * TILEWIDTH;
    translation[Y] = boost::math::round( (translation[Y]/TILEWIDTH) ) * TILEWIDTH;
}

Could you provide a complete example that fails to compile for you?

Thanks,
Nate
                                               


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