PDA

View Full Version : Application crash after using install_name_tool




shanmughams
Jan 12, 2012, 01:30 PM
Hi,
Iam creating a MAC application using wxWidget dynamic libs and they are kept inside /Applications/MyNewAppl/bin/MyNewAppl.app/Contents/MacOS/./../Frameworks dir . The same wxWidget dylibs are also available in /usr/local/lib. I want my application to use the dylibs packaged under framework directory. I used install_name_tool to point the dylibs in the framework dir as below.

install_name_tool -id @executable_path/../Frameworks/libneon.27.dylib ../../../MyNewAppl.app/Contents/Frameworks/libneon.27.dylib
install_name_tool -id @executable_path/../Frameworks/liblog4cpp.4.dylib ../../../MyNewAppl.app/Contents/Frameworks/liblog4cpp.4.dylib
install_name_tool -id @executable_path/../Frameworks/libwx_osx_cocoau_core-2.9.dylib ../../../MyNewAppl.app/Contents/Frameworks/libwx_osx_cocoau_core-2.9.dylib
install_name_tool -id @executable_path/../Frameworks/libwx_baseu-2.9.dylib ../../../MyNewAppl.app/Contents/Frameworks/libwx_baseu-2.9.dylib
install_name_tool -id @executable_path/../Frameworks/libwx_osx_cocoau_adv-2.9.dylib ../../../MyNewAppl.app/Contents/Frameworks/libwx_osx_cocoau_adv-2.9.dylib


install_name_tool -change /usr/lib/libneon.27.dylib @executable_path/libneon.27.dylib MyNewAppl.app/Contents/MacOS/MyNewAppl
install_name_tool -change /usr/local/lib/liblog4cpp.4.dylib @executable_path/liblog4cpp.4.dylib MyNewAppl.app/Contents/MacOS/MyNewAppl
install_name_tool -change /usr/local/lib/libwx_osx_cocoau_core-2.9.dylib @executable_path/libwx_osx_cocoau_core-2.9.dylib MyNewAppl.app/Contents/MacOS/MyNewAppl
install_name_tool -change /usr/local/lib/libwx_baseu-2.9.dylib @executable_path/libwx_baseu-2.9.dylib MyNewAppl.app/Contents/MacOS/MyNewAppl
install_name_tool -change /usr/local/lib/libwx_osx_cocoau_adv-2.9.dylib @executable_path/libwx_osx_cocoau_adv-2.9.dylib MyNewAppl.app/Contents/MacOS/MyNewAppl

When I start the application, it crashes. I Have attached 2 files containing the crash report & error message shown in the terminal.

Need your help quickly to resolve this crash.

Thanks
Shan'



jiminaus
Jan 12, 2012, 01:59 PM
I don't know if this is the problem, but these are not frameworks. Frameworks are directories which contain (among other things) the .dylib file(s).

I would put these .dylib files directly under Contents/MacOS.


EDIT: You seem to be linking to both @executable_path/../Frameworks/libwx_osx_cocoau_core-2.9.dylib and /usr/local/lib/libwx_osx_cocoau_core-2.9.2.0.0.dylib. This might because one of the other .dylibs is linking to /usr/local/lib/libwx_osx_cocoau_core-2.9.2.0.0.dylib.