I have got an application that needs to be set up with macdeployqt, but when I call it, it tells me that it cannot find some libs into /usr/lib/ directory.
Before calling macdeployqt I have to insert 3 libs (.tx) into my .app. I used otool command to view the dependencies and here is the output of one of them :
RecomputeDimBlock.tx:
RecomputeDimBlock.tx (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.0.0)
libTD_Db.dylib (compatibility version 0.0.0, current version 0.0.0)
libTD_DbRoot.dylib (compatibility version 0.0.0, current version 0.0.0)
libTD_Ge.dylib (compatibility version 0.0.0, current version 0.0.0)
libTD_Root.dylib (compatibility version 0.0.0, current version 0.0.0)
libTD_Alloc.dylib (compatibility version 0.0.0, current version 0.0.0)
libTD_Gi.dylib (compatibility version 0.0.0, current version 0.0.0)
libTD_SpatialIndex.dylib (compatibility version 0.0.0, current version 0.0.0)
libsisl.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
I also insert every "libTD_xx" with my tx. And then, I relink those libs. I have made a bash script to automate those steps :
#!/bin/bash
if [ ! -e build/debug/MediaCad.app ]
then
echo MediaCad.app non trouvé dans build/debug/
echo Sortie du script
exit 1
fi
#Création du dossier « tx » dans le .app s’il n’existe pas
if [ ! -d build/debug/MediaCad.app/Contents/tx ]
then
mkdir -p build/debug/MediaCad.app/Contents/tx
fi
#placement des tx et des libs dans le .app
for tx in RecomputeDimBlock.tx PlotSettingsValidator.tx ThreadPool.tx libTD_Db.dylib libTD_DbRoot.dylib libTD_Gi.dylib libTD_SpatialIndex.dylib libTD_Ge.dylib libTD_Root.dylib libsisl.dylib libTD_Alloc.dylib
do
if [ -e tx/$tx ]
then
echo Copie de $tx dans l’application
cp tx/$tx build/debug/MediaCad.app/Contents/tx
else
echo Impossible de trouver le fichier $tx dans tx/
echo Sortie du script
exit 1
fi
done
#installation des libs
cd tx/
for lib in libTD_Db.dylib libTD_DbRoot.dylib libTD_Gi.dylib libTD_SpatialIndex.dylib libTD_Ge.dylib libTD_Root.dylib libsisl.dylib libTD_Alloc.dylib
do
echo Installation de $lib
install_name_tool -id $lib ../build/debug/MediaCad.app/Contents/tx/$lib
install_name_tool -change $lib @executable_path/../tx/$lib ../build/debug/MediaCad.app/Contents/MacOS/MediaCad
done
#Actualisation des dépendances
for tx in RecomputeDimBlock.tx PlotSettingsValidator.tx ThreadPool.tx
do
for lib in libTD_Db.dylib libTD_DbRoot.dylib libTD_Gi.dylib libTD_SpatialIndex.dylib libTD_Ge.dylib libTD_Root.dylib libsisl.dylib libTD_Alloc.dylib
do
echo Actualisation de $lib pour $tx
install_name_tool -change $lib @executable_path/../tx/$lib ../build/debug/MediaCad.app/Contents/tx/$tx
done
done
cd ..
#génération du .app
echo Début de la construction de l’application
/Users/developpement/Qt/5.7/clang_64/bin/macdeployqt build/debug/MediaCad.app
echo Application construite
When I execute my script, everything works fine except macdeployqt. Here is the output :
ERROR: no file at "/usr/lib/libTD_Alloc.dylib"
ERROR: no file at "/usr/lib/libTD_DbRoot.dylib"
ERROR: no file at "/usr/lib/libTD_Gi.dylib"
ERROR: no file at "/usr/lib/libTD_Ge.dylib"
ERROR: no file at "/usr/lib/libTD_Root.dylib"
ERROR: no file at "/usr/lib/libTD_SpatialIndex.dylib"
ERROR: no file at "/usr/lib/libsisl.dylib"
Those libs are the ones that I copied inside my .app at the beginning.
I presume that I'm doing something wrong with install_name_tool but I can't see where ? I have spent 3 days on it so that's why I asking my question here. One last thing, I work with OS X 10.11 and Qt 5.7.
If something is not clear do not hesitate to tell me, I know my english is not perfect :)
Thank you !
Try using the -libpath option of macdeployqt. It should point to the folder where you have got those dylib files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With