I use Boost 1.42 and gcc 4.3.1 on HP-UX 11.31. So today I defined NDEBUG and BOOST_DISABLE_ASSERTS in my makefile, ran make and got this error: ../../../src/libs/src/external/boost/1.42.0/boost/interprocess/sync/posix/semaphore_wrapper.hpp: In function 'void boost::interprocess::detail::semaphore_close(sem_t*)': ../../../src/libs/src/external/boost/1.42.0/boost/interprocess/sync/posix/semaphore_wrapper.hpp:102: error: 'assert' was not declared in this scope ../../../src/libs/src/external/boost/1.42.0/boost/interprocess/sync/posix/semaphore_wrapper.hpp: In function 'void boost::interprocess::detail::semaphore_destroy(sem_t*)': ../../../src/libs/src/external/boost/1.42.0/boost/interprocess/sync/posix/semaphore_wrapper.hpp:137: error: 'assert' was not declared in this scope If I do not set NDEBUG and BOOST_DISABLE_ASSERTS everything is OK. Seems like the problem is that in semaphore_wrapper.hpp there is a call to assert() and if NDEBUG is set then correct headers are not included.