Boost C++ Libraries: Ticket #13258: boost/archive/text_iarchive.hpp memory leaks with MFC! https://svn.boost.org/trac10/ticket/13258 <p> visual studio 2017 community edition; boost c++, 1.65 installed through vcpkg; </p> <p> reproducing steps. </p> <ol><li>install vcpkg; vcpkg install boost </li><li>create a new project with mfc shared support; </li><li>add #include &lt;boost/archive/text_iarchive.hpp&gt; to stdafx.h </li><li>build -&gt; run -&gt; exit </li><li>visual studio will generate messages like: </li></ol><pre class="wiki">Detected memory leaks! Dumping objects -&gt; {180} normal block at 0x01546820, 8 bytes long. Data: &lt; L &gt; E8 F1 4C 01 00 00 00 00 {179} normal block at 0x01546510, 20 bytes long. Data: &lt; eT eT eT &gt; 10 65 54 01 10 65 54 01 10 65 54 01 01 01 CD CD {178} normal block at 0x01546AC0, 8 bytes long. Data: &lt; L &gt; D0 F1 4C 01 00 00 00 00 {177} normal block at 0x01546790, 20 bytes long. Data: &lt; gT gT gT &gt; 90 67 54 01 90 67 54 01 90 67 54 01 01 01 CD CD {176} normal block at 0x0153B948, 8 bytes long. Data: &lt;` L &gt; 60 F1 4C 01 00 00 00 00 {175} normal block at 0x01546190, 20 bytes long. Data: &lt; aT aT aT &gt; 90 61 54 01 90 61 54 01 90 61 54 01 01 01 CD CD {174} normal block at 0x0153BA98, 8 bytes long. Data: &lt;H L &gt; 48 F1 4C 01 00 00 00 00 {173} normal block at 0x015435A8, 20 bytes long. Data: &lt; 5T 5T 5T &gt; A8 35 54 01 A8 35 54 01 A8 35 54 01 01 01 CD CD {172} normal block at 0x0153B8A0, 8 bytes long. Data: &lt;0 L &gt; 30 F1 4C 01 00 00 00 00 {171} normal block at 0x01543568, 20 bytes long. Data: &lt;h5T h5T h5T &gt; 68 35 54 01 68 35 54 01 68 35 54 01 01 01 CD CD {170} normal block at 0x0153BA28, 8 bytes long. Data: &lt; L &gt; 18 F1 4C 01 00 00 00 00 {169} normal block at 0x01543528, 20 bytes long. </pre><p> I can finally nail down to these two headers; If they exist in stdafx.h at the same time, there will be memory leakage errors. </p> <pre class="wiki">#include &lt;afxwin.h&gt; // MFC core and standard components #include &lt;boost/archive/text_iarchive.hpp&gt; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13258 Trac 1.4.3