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.
C++

Avatar of undefined
Last Comment
evilrix

8/22/2022 - Mon
evilrix

Which version of boost?
JPERKS1985

ASKER
1.47
evilrix

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?
Your help has saved me hundreds of hours of internet surfing.
fblack61
JPERKS1985

ASKER
i thought i was but who knows. What do I need to select to ensure that it is a native application?
ASKER CERTIFIED SOLUTION
evilrix

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question