Qt Mac OSX 10.8 Dyld:库未加载...图像未找到 [英] qt mac osx 10.8 dyld: library not loaded...image not found

查看:171
本文介绍了Qt Mac OSX 10.8 Dyld:库未加载...图像未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在使用Qt 4.7.4在osx雪豹下构建并运行良好的应用程序,但是该macbook死了.我现在正在设置一台运行山狮(10.8.2)和Qt 4.8.3的新Macbook.我可以构建我的应用程序,但是当我尝试从Qt Creator 2.6.0中运行它时,出现此运行时错误:

I have an app I was building and running fine under osx snow leopard with Qt 4.7.4, but that macbook died. I now am setting up a new macbook running mountain lion (10.8.2) and Qt 4.8.3. I can build my app, but when I try to run it from within Qt Creator 2.6.0, I get this run time error:

dyld: Library not loaded: ../lib/libicudata.46.1.dylib
  Referenced from: /Users/david/dev/svn/map_creator/karte-build-Desktop-Debug/debug/MapCreator.app/Contents/MacOS/MapCreator
  Reason: image not found
The program has unexpectedly finished.

从Finder运行该错误.

I get a similar error running it from Finder.

otool给了我

Davids-MacBook-Pro:map_creator david$ otool -L karte-build-Desktop-Debug/debug/MapCreator.app/Contents/MacOS/MapCreator 
karte-build-Desktop-Debug/debug/MapCreator.app/Contents/MacOS/MapCreator:
    ../lib/libicudata.46.1.dylib (compatibility version 46.0.0, current version 46.1.0)
    libicui18n.46.dylib (compatibility version 46.0.0, current version 46.1.0)
    libicuuc.46.dylib (compatibility version 46.0.0, current version 46.1.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.11.0)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 55179.1.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1187.34.0)
    /Users/david/dev/qt483/lib/QtSvg_fmosoft.framework/Versions/4/QtSvg_fmosoft (compatibility version 4.8.0, current version 4.8.3)
    /Users/david/dev/qt483/lib/QtGui_fmosoft.framework/Versions/4/QtGui_fmosoft (compatibility version 4.8.0, current version 4.8.3)
    /Users/david/dev/qt483/lib/QtCore_fmosoft.framework/Versions/4/QtCore_fmosoft (compatibility version 4.8.0, current version 4.8.3)
    /Users/david/dev/qt483/lib/QtXmlPatterns_fmosoft.framework/Versions/4/QtXmlPatterns_fmosoft (compatibility version 4.8.0, current version 4.8.3)
    /Users/david/dev/qt483/lib/QtNetwork_fmosoft.framework/Versions/4/QtNetwork_fmosoft (compatibility version 4.8.0, current version 4.8.3)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1669.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.12.0)

是从雪豹到美洲狮,还是从Qt 4.7.4更改为4.8.3,这是导致此问题的原因吗?或者,也许我错过了在我的新Macbook上进行所有设置的步骤?我仍在学习-实际上只是Qt和Mac上的新手,在主要开发人员离开后尝试维护该项目.

Did something change from snow leopard to mountain lion, or from Qt 4.7.4 to 4.8.3, that is causing this issue? Or maybe I missed a step getting everything set up on my new macbook? I'm still learning - really just a novice on both Qt and Mac, trying to maintain this project after the primary developer has left.

谢谢, 大卫

推荐答案

在Qt项目设置中,在运行时设置下,您必须将路径添加到编译的ICU库中.有一个网格,您可以在其中设置环境变量等.所需的网格是DYLD_LIBRARY_PATH,并设置(或附加)ICU库的路径.

In your Qt project settings, under runtime settings, you will have to add the path to the ICU libraries that you compiled. There is a grid where you set environment variables, etc. The one you want is DYLD_LIBRARY_PATH, and set (or append) the path to the ICU libraries.

这将使Qt能够将../lib/libicudata.46.1.dylib解析为实际的库文件.

That will enable Qt to resolve ../lib/libicudata.46.1.dylib to the actual library file.

这篇关于Qt Mac OSX 10.8 Dyld:库未加载...图像未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆