Library not found on Mac OS
-
What version of Qt are you using ?
How did you call macdeployqt ? Also where did you call if from ?
What version of OS X are you using ?
-
wrote on 2 Aug 2016, 12:08 last edited by
I use Qt 5.7. I called macdeploy like that :
/Users/developpement/Qt/5.7/clang_64/bin/macdeployqt MediaCad.app
and I the output is :
ERROR: no file at "/usr/lib/libMdCore.1.dylib" ERROR: no file at "/usr/lib/libMdWidgets.1.dylib" ERROR: no file at "/usr/lib/libMdModels.1.dylib"
I call it from my .app directory.
I have tried to call it with -verbose=3 and here is the output : http://textup.fr/172668xw
I'm using OS X 10.11.5
-
Ok try with:
Add
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
to your libraries .pro file
and
QMAKE_RPATHDIR += /path_your_libs_dir/
to your application .pro file
-
wrote on 3 Aug 2016, 08:13 last edited by
So, I tried that but I still got the same error with macdeploy and the same exception in my app. Maybe I did it wrong :
I add QMAKE_FLAGS_SONAME = -Wl, -install_name, @rpath/
and in my app .pro : DEPENDPATH += ../debugI have tried to change the first one into QMAKE_FLAGS_SONAME = -Wl, -install_name, ../debug/ but still the same thing.
The exception is about RecomputeDimBlock.tx, which is not a lib from me, so I can't apply anything to it
-
Why
DEPENDPATH
? It's not the same thing asQMAKE_RPATHDIR
.Also, I'd rather try with the full path using the
OUT_PWD
variable withQMAKE_RPATHDIR
-
wrote on 3 Aug 2016, 09:45 last edited by
I just copy/paste the wrong line, I have tested with QMAKE_DIRPATH.
It didn't change with OUT_PWD.
Maybe there is a thing to do with command install_name_tool on all library ? I will take a look on this trail -
Again, it's not
QMAKE_DIRPATH
, it'sQMAKE_RPATHDIR
-
wrote on 3 Aug 2016, 12:08 last edited by
erf... I should go back to school and learn to read again !
so now I have : QMAKE_RPATHDIR=OUT_PWD/../debug
but, nothing has changed -
Did you forgot the double $ before
OUT_PWD
? -
wrote on 3 Aug 2016, 12:52 last edited by
Oh... Yes... It explains why it didn't work !
The command macdeploy now works fine ! A lot a thing appeared in the .app. But the .tx is still not detected even after copying it on the right directory -
Can you remind me what these .tx files are ?
-
wrote on 3 Aug 2016, 14:03 last edited by
In my case .tx is a lib provided by ODA library.
When my app start, I use a function "loadapp" from ODA, to load my .tx. After debugging it seams that this function is looking for the tx into <myapp.app>/Contents/MacOS directory, so I placed my lib here but it still doesn't detect it -
macdeployqt won't handle them because it currently only targets .framework and .dylib.
If we want to nitpick, putting "plugin" in the MacOS folder is wrong from a bundle point of view.
You have to write a script that copies these .tx file at the right place and call install_name_tool on them to update the paths to all their dependencies (excluding the system libraries)
-
wrote on 4 Aug 2016, 07:47 last edited by
ok so if I understood correctly, I have to write a script that first build my .app, then copy the .tx into MacOS and finally apply install_name_tool ?
-
Not necessarily. I was more thinking about a post-macdeployqt script that would handle the .tx files.
-
wrote on 4 Aug 2016, 08:35 last edited by
ok, given that I'm an intern and my internship will end next week, I prefer writing a bash script that makes everything, that will be easier for my workmate in the future.
Is there anyway to tell Qt that it has to call this script after compiling ? -
What do you mean by everything ? Run macdeployqt or build your application + macdeployqt + .tx deployment ?
-
wrote on 4 Aug 2016, 08:59 last edited by
Yes, after compiling, the script calls macdeployqt, and install every tx properly, the application should work after that (I hope).
For the moment I just call macdeployqt and copy every tx into MacOS. -
It's been a long time since I've done this but IIRC you should be able to do that adding a custom target.
See qmake's adding custom targets documentation.
-
wrote on 4 Aug 2016, 12:00 last edited by
Thanks for your help ! I will take a look a that, and post another thread if I have a lot of problems.
13/23