Skip navigation
Currently Being Moderated

Plugins, deployment & Qt on a Mac

Jun 11, 2012 2:46 AM

I have a plug-in that links to the Qt framework (QtCore.framework and QtGui.framework) on Mac OS X 10.6.8 - XCode 3.2.6


So I'm trying to deploy the plug-in onto a mac that doesn't already have the Qt framework installed, but with no success so far. This is what I've done:


Added a Copy Files Build Phase to copy QtCore.framework & QtGui.framework to my plug-in bundle's Frameworks folder.

Added a "Run Script Phase" to alter the install names of the frameworks which looks like this:


install_name_tool -id @loader_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${BUILD_DIR}"/"${WRAPPER_NAME}/Contents/Frameworks/QtCore.framework/V ersions/4/QtCore

install_name_tool -id @loader_path/../Frameworks/QtGui.framework/Versions/4/QtGui ${BUILD_DIR}"/"${WRAPPER_NAME}/Contents/Frameworks/QtGui.framework/Ve rsions/4/QtGui


install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore @loader_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${BUILD_DIR}"/"${WRAPPER_NAME}/Contents/MacOS/QtDeploymentTest


install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtGui.framework/Versions/4/QtGui@lo ader_path/../Frameworks/QtGui.framework/Version/4/QtGui ${BUILD_DIR}"/"${WRAPPER_NAME}/Contents/MacOS/QtDeploymentTest


install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore @loader_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${BUILD_DIR}"/"${WRAPPER_NAME}/Contents/Frameworks/QtGui.framework/Ve rsions/4/QtGui


But when Illustrator attempts to load the plug-in on the target mac, I'm getting this error:


Error loading /Applications/Adobe Illustrator CS5.1/Plug-ins.localized/QtDeploymentTest.aip/Contents/MacOS/QtDeploy mentTest:  dlopen(/Applications/Adobe Illustrator CS5.1/Plug-ins.localized/QtDeploymentTest.aip/Contents/MacOS/QtDeploy mentTest, 262): Library not loaded: @loader_path/../Frameworks/QtCore.framework/QtCore

  Referenced from: /Applications/Adobe Illustrator CS5.1/Plug-ins.localized/QtDeploymentTest.aip/Contents/MacOS/../Frame works/QtGui.framework/QtGui

  Reason: image not found


Any ideas anyone? I was under the understanding that @loader_path should be the path to my plug-in's executable but ld still fails to load it.

  • Currently Being Moderated
    Jun 11, 2012 10:20 AM   in reply to Wayne Constable

    The problem appears to be QtGui trying to load QtCore, in this case QtGui will need a path to QtCore more along the lines of:


    double check my '..' count


    AFAIK, the @loader_path is set to QtGui once that is being loaded. 


    You could also look at using rpath, there might be less figuring out what the relative paths are from each dylib to the next.

    Mark as:
  • Currently Being Moderated
    Jun 12, 2012 6:30 AM   in reply to Wayne Constable

    No prob, happy to help anyone brave enough to use Qt with AI

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points