Link to home
Start Free TrialLog in
Avatar of JPERKS1985
JPERKS1985

asked on

#include <boost/algorithm/string.hpp> produces Error 3 error C2059: syntax error : 'reinterpret_cast' \boost\function\function_template.hpp 566 1

I'm trying to include the string.hpp boost file, when I do this I get the error,

error C2059: syntax error : 'reinterpret_cast'      \boost\function\function_template.hpp      566      

This line within function_template.hpp is,

        assign_functor(FunctionObj f, function_buffer& functor, mpl::true_) const
        {
         ERROR LINE -------> new (reinterpret_cast<void*>(&functor.data)) FunctionObj(f);
        }

How can this be fixed? I'm using VS2010.
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Which version of boost?
Avatar of JPERKS1985
JPERKS1985

ASKER

1.47
So, I downloaded in installed the Windows version of Boost (I generally develop only on Linux ); the same version you have. I created a new project in Visual Studio 2010 and configured the include and library paths to point to where boost was installed (I took the default settings to install) and then created the follow small program.

#include <boost/algorithm/string.hpp>

int main()
{
   // nothing to see here
}

Open in new window


It built without error.

Are you sure you are building a native C++ application?
i thought i was but who knows. What do I need to select to ensure that it is a native application?
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial