Boost assert problem

Hi,

I have just started using boost and I am experiencing a problem.

My setup is:

QNX SDK 6.4, using the standard gcc 4 compiler.
boost 1.37.

When I user boost shared_ptr I get a compilation error:

boost/boost_1_37_0/boost/shared_ptr.hpp: In member function ‘T* boost::shared_ptr< >::operator->() const [with T = WEBLibrary::CFrame]’:
CMenuLink.cpp:22: instantiated from here
boost/boost_1_37_0/boost/shared_ptr.hpp:419: error: ‘assert’ was not declared in this scope

If I define one of the following two lines, I get no compilation error.

#define BOOST_DISABLE_ASSERTS
#define BOOST_ENABLE_ASSERT_HANDLER

I don’t think it makes any sense that I should make any one of these definitions every time I user a shared_ptr.

Does any one know what this is about, is this something I should configure somewhere

\Behrens

You can pass these symbol at compile time qcc -DBOOST_DISABLE_ASSERTS=1 -DBOOST_ENABLE_ASSERT_HANDLER.

Or what if you #include before including the boost header files, does it get rid of the error?

By the way check the POCO stuff, not as much stuff as BOOST but I find it much easier to use.

Thank you for the tip regarding -D option, I did not think of that. Neat trick :slight_smile:
Including does not help, same error.

I think I need to look more into how the two boost assert options affect my code.

Never heard of POCO, i will look into it.