title: Qt5. QMacNativeWidget. Undefined symbols for architecture x86_64
body: <p>Class <strong>QMacNativeWidget</strong> listed in Qt5 documentation, but any attempts to create Cocoa application with embedded Qt Widgets give me the next error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "QMacNativeWidget::QMacNativeWidget(void*)", referenced from:
        -[AppDelegate loadUi] in AppDelegate.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>@interface AppDelegate : NSObject &lt;NSApplicationDelegate&gt;
  {
      std::auto_ptr&lt;QWidget&gt; nativeWidget;
      ...
  }
  // Qt Widget will be attached to this view
  @property (weak) IBOutlet NSView *view; 
  @end
  
  - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
      [self initQtIfNeeded];
      [self loadUi];
  }
  
  -(void) initQtIfNeeded
  {
      QApplication* app = qApp;
      if (app == 0)
      {
          puts("Creating new QApplication instance...");
          QApplication::setDesktopSettingsAware(true);
          QApplication::setAttribute(Qt::AA_MacPluginApplication, true);
          int argc = 0;
          app = new QApplication(argc, NULL);
          ...
      }
  }
  
  -(void)loadUi
  {
      nativeWidget.reset(new QMacNativeWidget());
      ...
  
      // Casting pointer (x86_64 with ARC)
      void* winId = reinterpret_cast&lt;void *&gt;(nativeWidget-&gt;winId());
      NSView *nativeWidgetNSView = (__bridge NSView*)winId;
  
      // Attaching Qt Widget to NSView
      [self.view addSubview:nativeWidgetNSView positioned:NSWindowAbove relativeTo:nil];
      nativeWidget-&gt;setGeometry(0, 0, self.view.frame.size.width, self.view.frame.size.height);
  
      ...
  
      nativeWidget-&gt;show();
  }
  </code></pre>
  
  <p>When i am using QWidget instead of QMacNativeWidget (i.e.: <code>nativeWidget.reset(new QWidget());</code>) application get linked successfully but at runtime additional window created .(</p>
  
  <p><a href="http://i.stack.imgur.com/lUySd.png" rel="nofollow">Screenshot</a></p>
  
  <p><strong>My question:</strong> Am i doing something wrong or it is Qt issue?
  Thanks!</p>