title: How to properly back reference symbols in executable from dll?
body: <p>I'm writing a Qt program, which dynamicly loads plugins. But the plugins require the class declared in the main program. I tried to include the headers in the library and add <code>-export-dynamic</code> for program linker, which work quite fine on linux.</p>
  <p>However, MSVC toolchains seems don't have such option. The build failed because of the missing of classes' vtable and metaObject. If I add the headers to the library (that let moc to process the header), it still failed for missing implemention of classes' methods.</p>
  <p>I've search some questions. They suggest making the main program be a dll, or use dllexport/dllimport for all the classes. And I'm not sure if this work for those things generated by moc. In my opinion, it would cause redefinition.</p>
  <p>Is there a better way to solve it? Or is there a best practice for this problem?</p>
  <hr />
  <p>Main Program:
  class A, B, C</p>
  <p>Plugin:
  class P which need to process A, B and C</p>