title: Qt Designer undefined symbol with Custom Widget plugin
body: <p>I am using Qt 4.7.2 under Fedora 14.</p>
  
  <p>I have a working library of custom widgets which I am trying to integrate into Qt Designer.
  There is a simple widget base class, then some more complex widgets inheriting from it.
  The simple widget integrates fine, but I have a problem with the more complex ones.</p>
  
  <p>The problem comes from the fact that that the more complex ones require a special structure to be passed to them on creation. So my code for creating a complex widget in the plugin is:</p>
  
  <pre><code>QWidget *myPlugin::createWidget(QWidget *parent)
  {
      my_struct *xyz = new my_struct;
      return new myWidget("MyWidget",xyz, parent);
  }
  </code></pre>
  
  <p>my_struct is just a simple C style struct with ints, doubles and arrays.</p>
  
  <p>Then when I start Qt Designer with this plugin I get:</p>
  
  <pre><code>/usr/lib64/qt4/bin/designer: symbol lookup error: /usr/lib64/qt4/plugins/designer/libMyPlugin.so: undefined symbol: _ZN8MyWidgetC1E7QStringP17my_structP7QWidget
  </code></pre>
  
  <p>I am building a release version of the plugin, not a debug version.</p>
  
  <p>I also tried defining xyz as a static class variable in the plugin and just passing its address to the constructor, but I still get the same error.</p>
  
  <p>I also tried adding xyx as an unused static class variable to my simple widget and that does not give the error, so the error seems to be coming from the call to the myWidget constuctor.</p>
  
  <p>Can anyone help me resolve this?</p>
  
  <hr>
  
  <p>Thanks Arne,</p>
  
  <p>You were right. </p>
  
  <p>I added my library explicitly to the plugin's .pro file and then it worked.</p>
  
  <p>What puzzles me is how could I build the plugin with no errors without the library?
  And why did my simple widget work without the library?</p>