Reputation: 3197
I had this problem with ICU in my app, trying to run in Qt Creator on my Mountain Lion MacBook Pro.
Now I discovered I have a similar problem at run time with a dmg that I build on this same MacBook Pro. The build completes successfully, running the dmg and installing appears successful, but when I try to run I get:
Dyld Error Message:
Library not loaded: @executable_path/../Frameworks/libicuuc.46.dylib
Referenced from: /Applications/MapCreator.app/Contents/SharedLibraries/libicui18n.46.1.dylib
Reason: image not found
I grabbed a previous tagged version of our app (and build script) from source control and I get the same problem when it's built on this MacBook.
The only errors I see when I run the build script are listed below. I believe these errors have always been present in our builds on all machines, and have never been a problem, but I list them here just in case it turns out to be helpful:
ERROR: "strip: can't map file: /Users/david/dev/svn/map_creator1.0.2/build/mac/pkg-root/Applications/MapCreator.app/Contents (Invalid argument)
"
ERROR: ""
ERROR: "install_name_tool: can't map file: /Users/david/dev/svn/map_creator1.0.2/build/mac/pkg-root/Applications/MapCreator.app/Contents/Frameworks//.. (Invalid argument)
"
ERROR: ""
ERROR: "otool: can't map file: /Users/david/dev/svn/map_creator1.0.2/build/mac/pkg-root/Applications/MapCreator.app/Contents/Frameworks//.. (Invalid argument)
"
ERROR: no file at "/usr/lib/libicui18n.46.dylib"
ERROR: no file at "/usr/lib/libicuuc.46.dylib"
ERROR: no file at "/usr/lib/libicudata.46.dylib"
I'm not sure where to look to track this down. Can anyone point me in the right direction?
Upvotes: 1
Views: 693
Reputation: 3197
Apparently there is something different about the ICU install on my MacBook. The problem is solved by adding more install_name_tool -change
lines to our script, to change where it's looking for dependencies for the ICU files in question.
The format is:
install_name_tool -change old new file
If the "old" path doesn't match, it just ignores the command. So simply adding the new lines covers the bases of various possible ICU installs.
Upvotes: 1