[Qt-interest] Distributing Qt apps on Mac

Pavel Koshevoy pavel at aragog.com
Fri Apr 1 20:53:24 CEST 2011


On 4/1/11 12:04 PM, David Ching wrote:
>
> Hello,
>
> I have experience with Qt on Windows but am new to Qt on Mac.  I have 
> some basic questions for bulding and deploying on Mac:
>
> 1.There are two versions of Qt for Mac, Carbon and Cocoa.  Already, 
> this is a painful decision point for me.  In your experience, is 
> supporting Cocoa only (which I believe is Leopard, Snow Leopard, etc.) 
> enough?
>
> 2.I installed Qt 4.7.1 Carbon SDK onto my Snow Leopard MacBook, built 
> my app, ran ‘macdeployqt’.  Using “otool –L”, this showed that the Qt 
> “frameworks” (and not “.dylibs”) were stored into my .app bundle.  I 
> am confused about this whole “framework” concept --- how are these 
> different/better than simple .dylibs?
>
>

Frameworks can include separate resource files (even header files) in 
addition to .dylibs.  In the past when I built Qt Carbon I configured it 
for dylibs.  When I build Qt Cocoa I use frameworks.

BTW, as far as I remember macdeployqt will not pull in non-Qt 
dependencies into the bundle.  I wrote my own deployment shell script 
that pulls in all the dependencies.  If anyone wants it I can post it 
here.  You may need to tailor it to suit your environment.


> 4.The app built in #2 resulted in a successful deployment onto Snow 
> Leopard, but when run on Leopard, the error in Console shows:
>
> dyld: lazy symbol binding failed: Symbol not found: 
> __ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i 
>
>
> Referenced from: /Applications/MyApp.app/Contents/MacOS/MyApp
>
> Expected in: /usr/lib/libstdc++.6.dylib
>

So, you built on OSX 10.6 and tried to run on OSX 10.5.  What was your 
deployment target?  In Xcode you can specify the SDK and target.  You 
may be able to do this in the .pro file:

macx {
     QMAKE_CXXFLAGS_DEBUG += -mmacosx-version-min=10.5 -isysroot 
/Developer/SDKs/MacOSX10.5.sdk
     QMAKE_CXXFLAGS_RELEASE += -mmacosx-version-min=10.5  -isysroot 
/Developer/SDKs/MacOSX10.5.sdk
}

You'll have to make sure that any other frameworks/libraries you link to 
are also 10.5 compatible.  This may mean you'll have to rebuild Qt yourself.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110401/8feafee4/attachment.html 


More information about the Qt-interest-old mailing list