Error no file at “/usr/lib/<libs>” when executing macdeployqt
-
I ran into this problem as well. The location '/usr/lib' is treated in a special way. Anything that starts with this path is excluded automatically.
I install my copy of Qt in '/usr/lib/qt5/...'. It is probably not the right place for OSX but it is a left-over from where I usually install Qt in GNU/Linux. I found this path causes problems for macdeployqt as it won't use anything that starts with this path.
The reason they exclude this path is so that parts of the OS don't get included with your app. Some dependencies should be excluded as these are always provided by the OS.
My work around (solution) was to modify the source code for macdeployqt and add an exception to the excluded path for '/usr/lib/qt5'.
There are command line options that might help. I did look at these and they didn't work in my case but they might solve your problem.
-
Hi Rondog, thanks for your response
I have try to create a copy into /usr/lib/ but it says that the operation is not permitted. Since OSX 10.11, it is not possible to write on this directory.
The thing is I am trying to relink my dependense with install_name_tool but it seems that it's not working.
I will take a look on the source code of macdeployqt
-
Hi,
You calls are indeed wrong. Don't put
../build/debug/
in your path. It won't be valid at all once you move the bundle around.While having these libs in
Contents/tx
is wrong from a bundle point of view, if you put these libs there then the@executable_path/../tx/libname.tx
path is correct because@executable_path
will besomething/Contents/MacOS/
.What I would correct is the libTD path to also point to the folder were they are located.
Note that if you have to pass the original path you want to modify to
install_name_tool -change
-
The thing is if I remove
../build/debug
on the first or third call of install_name_tool, it tells me that there is no such file or directory for my libs.
I wrote my script according to a thread found on ODA forum that said :- Copy all required libraries to TeighaViewer.app/Contents/tx/ folder.
- For each library ($odalib) in tx folder perform following commands from the bin/macOsX_x64_*dll folder:
install_name_tool -id $odalib TeighaViewer.app/Contents/tx/$odalib install_name_tool -change $odalib @executable_path/../tx/$odalib TeighaViewer.app/Contents/MacOS/TeighaViewer
- For each library from tx folder update dependency to each library.
for lib in `ls TeighaViewer.app/Contents/tx` do for libdep in `ls TeighaViewer.app/Contents/tx` do install_name_tool -change $libdep @executable_path/../tx/$libdep TeighaViewer.app/Contents/tx/$lib done done
- Run macdeployqt for application to remove absolute path from Qt dependencies
macdeployqt TeighaViewer.app
for the second step I don't perform the command from the folder they ask, should I do this or move my script into my .app folder ?
-
Try the following:
- Build your app from scratch to have new bundle.
- Run macdeployqt on it
- Copy your .tx files in
Contents/Frameworks
- Copy the dependencies of your .tx files in
Contents/Frameworks
- Run
install_name_tool -id @executable_path/../Frameworks/name_of_your.tx
on all your .tx files - Run
install_name_tool -id @executable_path/../Frameworks/name_of_dependency.dylib
on all the dependencies of your .tx files (unless I'm mistaken they are all .dylib files). - Run
install_name_tool -change XXX.dylib @executable_path/../Frameworks/XXX.dylib
on all the .tx and their dependencies. XXX.dylib are the ones not coming from the system so the libTD_XXX libraries and libsisl etc.
[edit] fixed example SGaist
-
-
No,
XXX.something
must be the same. The only .tx argument you need there is the name of the file you callinstall_name_tool
on. -
So, I made every dependence like that :
install_name_tool -change libTD_SpatialIndex.dylib @executable_path/../Frameworks/libTD_SpatialIndex.dylib RecomputeDimBlock.tx install_name_tool -change libTD_SpatialIndex.dylib @executable_path/../Frameworks/libTD_SpatialIndex.dylib PlotSettingsValidator.tx install_name_tool -change libsisl.dylib @executable_path/../Frameworks/libsisl.dylib PlotSettingsValidator.tx install_name_tool -change libsisl.dylib @executable_path/../Frameworks/libsisl.dylib RecomputeDimBlock.tx
and still got the same error :
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"
Maybe what I'm trying to do is not the solution of my initial problem (the app can't find .tx). Maybe the problem comes from the ODA library on this version, I don't know... It works well on Windows but it's so strange and specific on Mac, I think I'm not enough experienced to face this kind of problem, and I never touched a Mac before, so it's very hard to get used to it
I have 45min left, I don't think I have time to try something else, thanks for your time and your answers, for each thread I wrote !
-
If you mean that macdeployqt still gives you the same error, then that's normal. We run it before modifying these libraries.
If you want macdeployqt to not scream at these libraries, you can change the original files and put the whole path to them with
-change
.