我有一個應用程序,我在OSX雪豹下用Qt 4.7.4編譯和運行,但是macbook死了。我現在正在建立一個新的運行山獅(10.8.2)和Qt 4.8.3的macbook。我可以建立我的應用程序,但是當我嘗試從Qt Creator的2.6.0中運行它,我得到這個運行時錯誤:qt mac osx 10.8 dyld:library not loaded ...圖像未找到
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中運行它。
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上只是一個新手,在主開發人員離開之後試圖維護這個項目。
謝謝, 大衛
我遇到了同樣的問題。我認爲在'.bashrc'中設置'DYLD_LIBRARY_PATH'就可以了,但是最終通過遵循你的指令來修復。更確切地說,對於新手來說,步驟如下:在項目設置面板中,按照Projects> Run(在Qt 4.8.5之類的東西下)> Run Environment> Add',然後添加'DYLD_LIBRARY_PATH',並將其設置爲所需的lib目錄。 – ying17zi
非常感謝你! – appsthatmatter
是否有更具擴展性的解決方案?我試圖建立一個沒有硬編碼任何東西的編譯系統,而且我對OS X的環境還算陌生。另外,我不使用Qt Creator。 –