I'm trying ot use boost for the first time in a long while and when I include the boost/thread.hpp header I get a compilation error inside boost itself:
c:\myproj\boost_1_46_0\boost\thread\win32\thread_heap_alloc.hpp(97): error C2061: syntax error : identifier 'heap_memory
c:\myproj\boost_1_46_0\boost\thread\detail\thread.hpp(134) : see reference to function template instantiation 'T *boost::detail::heap_new<boost::detail::thread_data<F>,void(__cdecl *)(void)>(A1 &&)' being compiled
with
[
T=boost::detail::thread_data<void (__cdecl *)(void)>,
F=void (__cdecl *)(void),
A1=void (__cdecl *)(void)
]`
This happens just by including the header, it doesn't seem to have anything to do with my code, but I can't see what to do about it, can anyone help?
If you're using the MSVC wizard, make sure to include the boost header
#include <boost/thread/thread.hpp>
before the generated block
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
It's possible you #included some other package that has a #define of 'new', which then breaks what Boost is trying to do with placement new. To see the code after pre-processing, compile with /P or /E and then search for this line in the output and see if it looks different.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With