Results 1 to 4 of 4

Thread: How to static link in 4.6. on Mac OS 10.5?

  1. #1
    Join Date
    Feb 2010
    Location
    Los Angeles
    Posts
    61
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question How to static link in 4.6. on Mac OS 10.5?

    Hello All,

    I just upgraded from 4.4 to 4.6 and my app does not contain the static libs anymore.
    My .pro file contains this line which worked in 4.4:

    CONFIG += static

    I found some hint in the web:

    QMAKE_LFLAGS += -static

    but that generates a liker error: ld_classic: can't locate file for: -lcrt0.o
    I am using the commercial version (qt-sdk-mac-commercial-2010.01.dmg).

    Any suggestions?
    Markus

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: How to static link in 4.6. on Mac OS 10.5?

    I guess 4.6 uses the "cocoa" backend. It is not possible to link statically against the cocoa-backend. Check whether this is the case by checking that any other Qt app compiled against that Qt links against "AppKit" and if this is the case, recompile Qt to use the "carbon" backend. Use this for static linking. Keep in mind that carbon is the old way and cocoa is the way to go. Make friends with the fact that you will not be able to use static linking any longer in the near future (As soon as the carbon backend gets dropped).
    It's nice to be important but it's more important to be nice.

  3. The following user says thank you to axeljaeger for this useful post:

    Markus (6th February 2010)

  4. #3
    Join Date
    Feb 2010
    Location
    Los Angeles
    Posts
    61
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to static link in 4.6. on Mac OS 10.5?

    Hallo Axel,

    I downloaded the source and compiled with -static. That works, except now I don't get TIFF and JPEG support.
    Does TIFF and JPEG not work with static?

    In case of Cocoa and dynamic linking, how do I deploy the needed libs?

    Thanks
    Markus
    p.s. Grüße an meine alte Heimat

  5. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: How to static link in 4.6. on Mac OS 10.5?

    The problem with static linking and image formats is that image formats in Qt are usually plugins and plugins do not work with static. Search for Q_IMPORT_PLUGIN in the Qt docs to see how to embed the image formats into your application.

    Regarding cocoa and distribution:

    Use the macdeployqt-utility. It comes with the Qt distribution.
    It's nice to be important but it's more important to be nice.

  6. The following user says thank you to axeljaeger for this useful post:

    Markus (9th February 2010)

Similar Threads

  1. statically link Qt libraries (not build static library)
    By mcarter in forum Qt Programming
    Replies: 3
    Last Post: 1st February 2010, 21:42
  2. How to link static libraries --- in .pro file settings?
    By jiapei100 in forum Qt Programming
    Replies: 1
    Last Post: 7th January 2010, 17:39
  3. Link problems with static MySQL plugin
    By nurtsi in forum Installation and Deployment
    Replies: 4
    Last Post: 20th September 2007, 16:32
  4. How to link it static?
    By Ashitaka in forum Qt Programming
    Replies: 1
    Last Post: 29th July 2006, 17:38
  5. Problem with libmng on static link
    By jlbrd in forum Installation and Deployment
    Replies: 2
    Last Post: 10th May 2006, 23:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.