OS X Loads DYLIB from App folder ignoring install_path … Oops?

Our Valentina Studio project has one Application target and dozen of plugins targets. Plugins are made as bundles.
All these targets build products into the same folder “Debug (Native)” or “Release (Universal)”.
Then Run Scripts do copy plugins into App package and using install_name utility correct install paths for them.

PROBLEM:

Into v4.8 of Valentina Studio we have add a new LT.dylib. This DYLIB was built as usually into the same folder, then copied inside of app package.

So APP knows that DYLIB must be found by path “@executable_path/../Frameworks/liblt.dylib”.
You expect that app will load this DYLIB right?

But in fact OS X loads DYLIB, which is located in the APP folder. Oops? Bug in OS X?

Yes, this follow to rule that DYLIBs are searched first in the app folder, but I’d expect that if we have specify install_paths then they should have highest priority. Right?

SOLUTION:

I have specify for LT.DYLIB target a separate folder “Debug (Native)(LT)” so lt.dylib is not anymore in the app folder and do not confuse OS X.

Published by

Ruslan Zasukhin

VP Engineering and New Technology Paradigma Software, Inc

Leave a Reply