title: Trying to deploy .app bundle on OSX
body: <p>Just stepped through the following tutorial: <a href="http://qt-project.org/doc/qt-4.8/deployment-mac.html#the-bundle" rel="nofollow">http://qt-project.org/doc/qt-4.8/deployment-mac.html#the-bundle</a></p>
  
  <p>When I ran otool on my app it looks like this: </p>
  
  <pre><code>qjson.framework/Versions/0/qjson (compatibility version 0.7.0, current version 0.7.1)
  libboost_date_time.dylib (compatibility version 0.0.0, current version 0.0.0)
  libQt.Shared.1.dylib (compatibility version 1.0.0, current version 1.0.0)
  libQt.Framework.1.dylib (compatibility version 1.0.0, current version 1.0.0)
  @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.1)
  @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.1)
  @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.1)
  /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
  /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 625.0.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
  </code></pre>
  
  <p>Before I did this it ran fine and was pointing to the this:</p>
  
  <pre><code>    /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.1)
  /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.1)
  /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.1)
  </code></pre>
  
  <p>Now when I open my app it crashes straight away. When I try and open it in the terminal I get the following issue:</p>
  
  <pre><code>objc[44337]: Class QNSImageView is implemented in both 
  /Users/me/MyApp/MyApp.app/Contents/MacOS/./../Frameworks/QtGui.framework/Versions/4/QtGui and /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Versions/4/QtGui. One of the two will be used. Which one is undefined.
  </code></pre>
  
  <p>Finished by a "segment fault" </p>
  
  <p>How can I make it so that I doesnt conflict? I've tried to run Qts deploy script but that didn't work either. What am I doing wrong?</p>
  
  <p>Edit:</p>
  
  <p>I tried to use their script again and this time Idid the following:</p>
  
  <pre><code>macdeployqt MyApp.app -dmg -no-plugins
  </code></pre>
  
  <p>This created a .dmg with my app in it that runs. The issue now is that nothing happens and when I ran it in the terminal I got this error:</p>
  
  <pre><code>QEventLoop: Cannot be used without QApplication
  QEventLoop: Cannot be used without QApplication
  </code></pre>
  
  <p>What happend to my eventloop? Nothing has changed with my app since I ran it perfectly from the finder and when i deployed it and ran it from the deplyod version. Makes no sense</p>
  
  <p>Update: Now I tried to remove the old app and build it from scratch using QtCreator. I then did the following: </p>
  
  <pre><code>bash-3.2$ /Users/me/Downloads/macdeployqt-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release/macdeployqt/macdeployqt MyApp.app
  copied "/Library/Frameworks/qjson.framework/Versions/0/qjson" to "MyApp.app/Contents/Frameworks/qjson.framework/Versions/0/qjson" 
  copied "/usr/lib/libboost_date_time.dylib" to "MyApp.app/Contents/Frameworks//libboost_date_time.dylib" 
  copied "/usr/lib/libQt.Shared.1.dylib" to "MyApp.app/Contents/Frameworks//libQt.Shared.1.dylib" 
  copied "/usr/lib/libQt.Framework.My.1.dylib" to "MyApp.app/Contents/Frameworks//libQt.Framework.My.1.dylib" 
  copied "/Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Versions/4/QtGui" to "MyApp.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui" 
  copied "/Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Resources/qt_menu.nib/classes.nib" to "MyApp.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/classes.nib" 
  copied "/Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Resources/qt_menu.nib/info.nib" to "MyApp.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/info.nib" 
  copied "/Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib" to "MyApp.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib" 
  copied "/Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtCore.framework/Versions/4/QtCore" to "MyApp.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore" 
  copied "/Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtNetwork.framework/Versions/4/QtNetwork" to "MyApp.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork" 
  copied "/Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtXml.framework/Versions/4/QtXml" to "MyApp.app/Contents/Frameworks/QtXml.framework/Versions/4/QtXml" 
  
  Deploying plugins from "/usr/plugins"
  Created configuration file: "MyApp.app/Contents/Resources/qt.conf" 
  This file sets the plugin search path to "MyApp.app/Contents/plugins" 
  </code></pre>
  
  <p>When I start it it still crashes, the same as before. My two libs "libQt.Shared.1.dylib" and "libQt.Framework.1.dylib" are not called that but both have symbolic links with those names. Could that have somthing to do with the crash? Or does it break the link and copies them into it? These two libs are libs that ive done myself and they are both using QtCore and QtNetwork. With otool the app looks to be poiting to the right stuff though:</p>
  
  <pre><code>@executable_path/../Frameworks/qjson.framework/Versions/0/qjson (compatibility version 0.7.0, current version 0.7.1)
  @executable_path/../Frameworks/libboost_date_time.dylib (compatibility version 0.0.0, current version 0.0.0)
  @executable_path/../Frameworks/libQt.Shared.1.dylib (compatibility version 1.0.0, current version 1.0.0)
  @executable_path/../Frameworks/libQt.Framework.My.1.dylib (compatibility version 1.0.0, current version 1.0.0)
  @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.1)
  @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.1)
  @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.1)
  /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
  /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 625.0.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
  </code></pre>
  
  <p>Please help me... </p>