[Interest] Build Qt from source in 32bit (-platform macx-clang-32)

Nuno Santos nunosantos at imaginando.pt
Fri May 29 18:51:58 CEST 2015


Rene,

I don’t know how did I trick myself thinking I had success. Later I tried to hack macdeployqt to write loader_path instead of executable_path but it didn’t worked. I have tried again manually and it didn’t worked. 

Today I have found this on dyld documentation:

@loader_path/
This variable is replaced with the path to the directory containing the  mach-o  binary  which
contains  the load command using @loader_path. Thus, in every binary, @loader_path resolves to
a different path, whereas @executable_path always resolves to the same path.  @loader_path  is
useful  as the load path for a framework/dylib embedded in a plug-in, if the final file system
location of the plugin-in unknown (so absolute paths cannot be used) or if the plug-in is used
by  multiple  applications (so @executable_path cannot be used). If the plug-in mach-o file is
at  /some/path/Myfilter.plugin/Contents/MacOS/Myfilter  and  a  framework  dylib  file  is  at
/some/path/Myfilter.plugin/Contents/Frameworks/Foo.framework/Versions/A/Foo,  then  the frame-work framework
work load path could be encoded as @loader_path/../Frameworks/Foo.framework/Versions/A/Foo and
the  Myfilter.plugin directory could be moved around in the file system and dyld will still be
able to load the embedded framework.

The bold part is really important because: 

- The loaded lib is in a path and then it says the framework is in another.
- At this point the framework is changed an the loading path is too

The solution is to change the loading path of dependent QtFrameworks to something like this:

install_name_tool -change /Users/nsantos/Qt/5.4/clang_32/lib/QtCore.framework/Versions/5/QtCore @loader_path/../../../QtCore.Framework/Versions/5/QtCore drc.vst/Contents/Frameworks/QtNetwork.framework/QtNetwork

I hope this info helps anyone with the same problem. This is tricky!

Best,

Nuno

> On 28/05/2015, at 20:44, René J.V. Bertin <rjvbertin at gmail.com> wrote:
> 
> On Thursday May 28 2015 20:00:27 Nuno Santos wrote:
> 
>> I will leave that for last resort. It’s less error prone for users. 
> 
> It strikes me that maybe you already have to use an installer, to ensure that the plugin is installed in the appropriate location?
> 
>> Thanks a lot for your help. It has been crucial!
> 
> LOL, where can I send the bill? ;)
> 
> Cheers,
> René

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150529/3f0c8789/attachment.html>


More information about the Interest mailing list