Boost C++ Libraries: Ticket #8961: Android build error: 'posix_memalign' was not declared in this scope https://svn.boost.org/trac10/ticket/8961 <p> I was compiling for Android NDK 9 and I got the following error: </p> <pre class="wiki">gcc.compile.c++ bin.v2/libs/log/build/gcc-android4.8/release/build-no/link-static/log-api-unix/runtime-link-static/threading-multi/threadsafe_queue.o libs/log/src/threadsafe_queue.cpp: In static member function 'static void* boost::log::v2s_mt_posix::aux::threadsafe_queue_impl::operator new(std::size_t)': libs/log/src/threadsafe_queue.cpp:174:36: error: 'posix_memalign' was not declared in this scope if (posix_memalign(&amp;p, 64, size) || !p) </pre><p> I fixed the problem by changing this block in libs/log/src/threadsafe_queue.cpp from: </p> <pre class="wiki">#if !(defined(sun) || defined(__sun)) || defined(__SunOS_5_11) || defined(__SunOS_5_12) #define BOOST_LOG_HAS_POSIX_MEMALIGN 1 #endif </pre><p> to: </p> <pre class="wiki">#if (!defined(__ANDROID__) &amp;&amp; !(defined(sun)) || defined(__sun)) || defined(__SunOS_5_11) || defined(__SunOS_5_12) #define BOOST_LOG_HAS_POSIX_MEMALIGN 1 #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8961 Trac 1.4.3 james.withers@… Sat, 03 Aug 2013 20:17:51 GMT keywords set https://svn.boost.org/trac10/ticket/8961#comment:1 https://svn.boost.org/trac10/ticket/8961#comment:1 <ul> <li><strong>keywords</strong> android posix_memalign added </li> </ul> Ticket viboes Sun, 04 Aug 2013 07:50:28 GMT component changed; owner set https://svn.boost.org/trac10/ticket/8961#comment:2 https://svn.boost.org/trac10/ticket/8961#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Andrey Semashev</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">log</span> </li> </ul> Ticket Andrey Semashev Sun, 04 Aug 2013 10:17:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8961#comment:3 https://svn.boost.org/trac10/ticket/8961#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Duplicates <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8815" title="#8815: Bugs: Android - error: 'posix_memalign' was not declared in this scope (closed: fixed)">#8815</a>. </p> Ticket