<p>I appreciate that contribution, but unfortunately I'm not willing to add <code>MLPACK_API</code> to every function and class in mlpack.  I believe that there are better ways to do this that involve generating a symbols list and telling the Windows compiler to export all of those symbols.  Maybe something based on this:</p>

<p><a href="https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/">https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/</a></p>

<p>My goal is to keep the complexity of the code overhead down as much as possible.  If we add something like <code>MLPACK_API</code> that is required by every non-templated function and class, very quickly we will find that (a) new contributors are confused by what it is (b) code gets committed without <code>MLPACK_API</code> because it is forgotten and (c) code review now takes more overhead because we have to remember when or if <code>MLPACK_API</code> is necessary.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/620#issuecomment-210559093">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGzoE1m_TxQvT6hgYOPHw-0mGBfpks5p38zYgaJpZM4IIheY.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/620#issuecomment-210559093"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>