Search code examples
macosqtshared-librariesexecute

Where does mac osx app require dependent libraries?


I have built a Qt project under mac, but I have problems executing.

Its dependencies have several dylib .

When building the project, the make tool only asks for one of the libs (for example lib.1.0.0,dylib out of lib.1.dylib, lib.1.0.dylib, lib.1.0.0.dylib, lib.1.0.0.0.dylib) - so I know to put it in the .pro file

Some look like links - but it is not always the lib version that looks like a file that is required as a dependency.

But at run time, I don't know which dylib I need, and where to put it. I tried to place all 4 lib versions in the folder where the app was created - the project folder - but the app didn't execute.

Having done the same in Linux, I had to put the libs in a place set on path - like /usr/local/libs

Where does mac like its libs (shared libs ?) in order to run ?


Solution

  • You should read this document on deploying Qt applications. It will answer your questions. Moving your libraries to a system library path is usually not a good idea.

    http://qt-project.org/doc/qt-5/macosx-deployment.html

    To sum this up though you need to change the binaries to tell them where the libs are using the otool command.