Boost C++ Libraries: Ticket #882: undeclared memcpy() in flex_string.hpp https://svn.boost.org/trac10/ticket/882 <pre class="wiki">I have been working on the Apache C++ Standard Library project (STDCXX): http://incubator.apache.org/stdcxx/ I've trying to compile the boost library with stdcxx. The details can be found here: http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200704.mbox/% 3c7BDB2168BEAEF14C98F1901FD2DE64386573EB@epmsa009.minsk.epam.com%3e Boost version: 1.33.1 STDCXX version: 4.2 I've got the error in boost/wave/util/flex_string.hpp: D:\_Libs\boost_1_33_1\boost/wave/util/flex_string.hpp(126) : error C3861: 'memcpy': identifier not found D:\_Libs\boost_1_33_1\boost/wave/util/flex_string.hpp(654) : see reference to function template instantiation 'Pod *boost::wave::util::flex_string_details::pod_copy&lt;char&gt;(const Pod *,const Pod *,Pod *)' being compiled with [ Pod=char ] D:\_Libs\boost_1_33_1\boost/wave/util/flex_string.hpp(643) : while compiling class template member function 'void boost::wave::util::AllocatorStringStorage&lt;E&gt;::reserve(unsigned int)' with [ E=char ] D:\_Libs\boost_1_33_1\boost/wave/util/flex_string.hpp(1154) : see reference to class template instantiation 'boost::wave::util::AllocatorStringStorage&lt;E&gt;' being compiled with [ E=char ] CALL "D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\..\..\VC\bin\vcvars32.BAT" &gt;nul "D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\..\..\VC\bin\cl" /Zm800 -nologo /EHsc -c -D_RWSTDDEBUG /Z7 /Od /Ob0 /EHsc /GR /MTd /Zc:forScope /Zc:wchar_t -I"bin\boost\libs\wave\build" -I"D:\_Libs\boost_1_33_1" -I"D:\_Projects\stdcxx_working\include" -I"D:\_Projects\stdcxx_working\include\ansi" -I"D:\_Projects\stdcxx_working\build\msvc-8.0\15s\include" -I"D:\_Libs\boost_1_33_1" -Fo"bin\boost\libs\wave\build\libboost_wave.lib\vc-8_0-stdcxx\debug\runtime-link-static\threading-multi\instantiate_cpp_exprgrammar.obj" -Tp"D:\_Libs\boost_1_33_1\libs\wave\build\../src/instantiate_cpp_exprgrammar.cpp" I propose to #include &lt;string.h&gt; in flex_string.hpp file to declare memcpy(). </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/882 Trac 1.4.3 Hartmut Kaiser Tue, 03 Apr 2007 21:32:04 GMT <link>https://svn.boost.org/trac10/ticket/882#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/882#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=353975 Originator: NO Fixed in Boost CVS::HEAD. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Tue, 03 Apr 2007 21:32:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/882#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/882#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=353975 Originator: NO Thank you for submitting a bug report to BOOST </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>farid_zaripov</dc:creator> <pubDate>Wed, 04 Apr 2007 13:28:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/882#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/882#comment:3</guid> <description> <pre class="wiki">Logged In: YES user_id=1760091 Originator: YES In addition I have compiled boost with stdcxx on gcc 3.4.4 / Cygwin and got the following errors: --------------------------------- In file included from /cygdrive/d/_libs/boost_1_33_1/boost/wave/wave_config.hpp:163, from /cygdrive/d/_libs/boost_1_33_1/libs/wave/build/../src/instantiate_cpp_exprgrammar.cpp:10: /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp: In member function `T* boost::wave::util::mallocator&lt;T&gt;::allocate(size_t, const T*)': /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp:195: error: there are no arguments to `malloc' that depend on a template parameter, so a declaration of `malloc' must be available /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp:195: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp:196: error: there are no arguments to `bad_alloc' that depend on a template parameter, so a declaration of `bad_alloc' must be available /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp: In member function `void boost::wave::util::SimpleStringStorage&lt;E, A&gt;::Init(typename A::size_type, typename A::size_type)': /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp:311: error: `bad_alloc' is not a member of `std' /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp: In member function `void boost::wave::util::SimpleStringStorage&lt;E, A&gt;::reserve(typename A::size_type)': /cygdrive/d/_libs/boost_1_33_1/boost/wave/util/flex_string.hpp:410: error: `bad_alloc' is not a member of `std' "gcc" -c -Wall -ftemplate-depth-255 -D_RWSTDDEBUG -g -O0 -fno-inline -mthreads -I"/cygdrive/d/_libs/boost_1_33_1/cygwin_bin/bin/boost/libs/wave/build" -I"/cygdrive/d/_libs/boost_1_33_1" -I "/cygdrive/d/_projects/stdcxx_working/include" -I "/cygdrive/d/_projects/stdcxx_working/include/ansi" -I "/cygdrive/d/_projects/stdcxx_working/cygwin/15s/include" -I "/cygdrive/d/_libs/boost_1_33_1" -o "/cygdrive/d/_libs/boost_1_33_1/cygwin_bin/bin/boost/libs/wave/build/libboost_wave.a/gcc-stdcxx/debug/runtime-link-static/threading-multi/instantiate_cpp_exprgrammar.o" "/cygdrive/d/_libs/boost_1_33_1/libs/wave/build/../src/instantiate_cpp_exprgrammar.cpp" --------------------------------- I propose to #include &lt;cstdlib&gt; to declare malloc() and #include &lt;new&gt; to declare bad_alloc. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Thu, 05 Apr 2007 13:07:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/882#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/882#comment:4</guid> <description> <pre class="wiki">Logged In: YES user_id=353975 Originator: NO Fixed in Boost CVS::HEAD. Thanks for reporting! Regards Hartmut </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Thu, 05 Apr 2007 13:07:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/882#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/882#comment:5</guid> <description> <pre class="wiki">Logged In: YES user_id=353975 Originator: NO Thank you for submitting a bug report to BOOST </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Thu, 05 Apr 2007 13:07:14 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/882#comment:6 https://svn.boost.org/trac10/ticket/882#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> Ticket