title: automatic shared library export in gcc
body: <p>When I have the following code:</p>
  
  <pre><code>extern "C"
  void depp(){}
  </code></pre>
  
  <p>compile and link with g++.exe, then I will get the "depp" symbol exported. </p>
  
  <p>If I add the following code:</p>
  
  <pre><code>extern "C"
  __declspec(dllexport) void depp2(){}
  </code></pre>
  
  <p>Only the second symbol will be exported.</p>
  
  <p>Is there a way to turn on automatic export of all symbols, even though there is a dllexport present?</p>
  
  <p>Background:
  I am building an s-function for matlab simulink. The exported symbols, that matlab use appear to be in the header files. So, no way for me to add dllexport. When I add my objects, which contain dllexport, the whole mex file becomes unusable.</p>