title: Deploying cocoa application and its C++ dylib how to pack them?
body: <p>I am new to cocoa and mac development. I have written an application which is combination of objective-c using cocoa framework and backend written in C++ library dylib.</p>
  
  <p>I am using xcode 4.6 and have the above two projects Cocoa app and my C++ library. C++ is also my own project. </p>
  
  <p>Now it is time for deployment. I want to make a pkg installer for it.
  I could run/debug it in the xcode 4.6 because I had added search library path in the object-c project settings to be the output directory of the C++ project. Therefore it could find the dependency and run without crash.</p>
  
  <p>Now in the Objective-C project tree inside the xcode I see products -> mysoftware.app file. if I find the location of this mysoftware.app file in the finder and run it, it crashes. I open the package contents of this app files and  I see contentsfollowing structure</p>
  
  <pre><code>   contents\(info.plist, MacOS, pkginfo, resources )
  </code></pre>
  
  <p>I do not see my C++ library in there, when I run mysoftware.app directly double clicking it crashes as it can not find the dylib I see the stack trace in the report window it can not find dylib, complaning that library not found usr/local/lib/mylib.dylib
  I have also manually put the dylib file in the .app within the MacOS where my executable is, hoping that it will find the lib from the same directory, it did not , gave the same message above and looking from the the sane location /usr/local/lib/mylib.dylib</p>
  
  <p>So my question is how do I resolve dependency of .app package for deployment, should I need to put the dylib inside the .app package ? how do I do that and then my next step would be to put this single .app thing in the pkg installer,</p>
  
  <p>Thanks</p>