title: dll Export/init problem (static vars init?) Visual Studio C++
body: <p>I want to run an example plugin for CLANG/LLVM. Specifically <code>llvm\tools\clang\examples\PrintFunctionNames</code>. I managed to build it and i see an <code>PrintFunctionNames.exports</code> but i dont think visual studios supports it. The file is simply <code>_ZN4llvm8Registry*</code>. I have no idea what that is but i suspect its namespace llvm, class Registry which is defined as</p>
  
  <pre><code>template &lt;typename T, typename U = RegistryTraits&lt;T&gt; &gt;
  class Registry {
  </code></pre>
  
  <p>I suspect the key line is at the end of the example file</p>
  
  <pre><code>static FrontendPluginRegistry::Add&lt;PrintFunctionNamesAction&gt; X("print-fns", "print function names");
  </code></pre>
  
  <p>print-fns is the name while the 2nd param is the desc. When i try loading/running the dll via </p>
  
  <pre><code>clang -cc1 -load printFunctionNames.dll -plugin print-fns a.c
  </code></pre>
  
  <p>I get an error about not finding <code>print-fns</code>. I suspect its because the static variable is never being initialize thus it never registers the plugin. A wrong dll name would get an error loading module msg.</p>
  
  <p>I created a def file and added it to my project. It compiled but still no luck. Here is my  def file</p>
  
  <pre><code>LIBRARY printFunctionNames
  EXPORTS
  X DATA
  </code></pre>
  
  <p>How do i register the plugin or get this example working?</p>