Boost C++ Libraries: Ticket #10911: boost/iostreams/filter/zlib.hpp gives C4275 warning with visual studio https://svn.boost.org/trac10/ticket/10911 <p> please change the line </p> <pre class="wiki"># pragma warning(disable:4251 4231 4660) // Dependencies not exported. </pre><p> to </p> <pre class="wiki"># pragma warning(disable:4251 4231 4660 4275) // Dependencies not exported. </pre><p> This will fix... </p> <pre class="wiki">1&gt;c:\development\boost_1_56_0\boost\iostreams\filter\zlib.hpp(138): warning C4275: non dll-interface class 'std::ios_base::failure' used as base for dll-interface class 'boost::iostreams::zlib_error' 1&gt; c:\program files (x86)\microsoft visual studio 12.0\vc\include\xiosbase(221) : see declaration of 'std::ios_base::failure' 1&gt; c:\development\boost_1_56_0\boost\iostreams\filter\zlib.hpp(138) : see declaration of 'boost::iostreams::zlib_error' </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10911 Trac 1.4.3 peter.klotz@… Tue, 30 Jun 2015 07:40:27 GMT <link>https://svn.boost.org/trac10/ticket/10911#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10911#comment:1</guid> <description> <p> We see the same kind of compiler warnings (in Boost 1.58.0) but emitted from several locations: </p> <pre class="wiki">I:\Boost\1.58.0\include\boost/iostreams/filter/bzip2.hpp(112) : warning C4275: non dll-interface class 'std::ios_base::failure' used as base for dll-interface class 'boost::iostreams::bzip2_error' xiosbase(221) : see declaration of 'std::ios_base::failure' I:\Boost\1.58.0\include\boost/iostreams/filter/bzip2.hpp(112) : see declaration of 'boost::iostreams::bzip2_error' I:\Boost\1.58.0\include\boost/iostreams/filter/zlib.hpp(138) : warning C4275: non dll-interface class 'std::ios_base::failure' used as base for dll-interface class 'boost::iostreams::zlib_error' xiosbase(221) : see declaration of 'std::ios_base::failure' I:\Boost\1.58.0\include\boost/iostreams/filter/zlib.hpp(138) : see declaration of 'boost::iostreams::zlib_error' I:\Boost\1.58.0\include\boost/iostreams/filter/gzip.hpp(356) : warning C4251: 'boost::iostreams::detail::gzip_header::file_name_' : class 'std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;' needs to have dll-interface to be used by clients of class 'boost::iostreams::detail::gzip_header' I:\Boost\1.58.0\include\boost/iostreams/filter/gzip.hpp(357) : warning C4251: 'boost::iostreams::detail::gzip_header::comment_' : class 'std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;' needs to have dll-interface to be used by clients of class 'boost::iostreams::detail::gzip_header' </pre><p> According to the MSDN C4275 and C4251 are non critical when deriving from or using STL types. </p> <p> C4275: <a class="ext-link" href="https://msdn.microsoft.com/en-us/library/3tdb471s.aspx"><span class="icon">​</span>https://msdn.microsoft.com/en-us/library/3tdb471s.aspx</a><br /> C4251: <a class="ext-link" href="https://msdn.microsoft.com/en-us/library/esew7y1w.aspx"><span class="icon">​</span>https://msdn.microsoft.com/en-us/library/esew7y1w.aspx</a> </p> <p> Since both std::ios_base::failure and std::string are STL types there should be no side effects from suppressing these warnings. </p> </description> <category>Ticket</category> </item> <item> <author>peter.klotz@…</author> <pubDate>Tue, 30 Jun 2015 07:44:23 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/10911 https://svn.boost.org/trac10/ticket/10911 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_1_58_0-IOStreamsWarnings.patch</span> </li> </ul> <p> Patch to fix the warnings </p> Ticket