install_name_tool relinking failure

Hi, ALL,

I am trying to build my application that depends on the wxWidgets.

I built wxWidgets myself and now I'm trying to copy everything into the Application Bundle to make a self-contained distribution.

Here is what I have:

In the wxWidgets build directory:

Igors-MacBook-Air:lib igorkorot$ pwd /Users/igorkorot/wxWidgets/buildC11/lib Igors-MacBook-Air:lib igorkorot$ ls -la libwx_base* -rwxr-xr-x 1 igorkorot staff 4524504 Jul 6 22:16 libwx_baseu-3.2.0.0.0.dylib lrwxr-xr-x 1 igorkorot staff 27 Jul 6 22:16 libwx_baseu-3.2.0.dylib -> libwx_baseu-3.2.0.0.0.dylib lrwxr-xr-x 1 igorkorot staff 23 Jul 6 22:16 libwx_baseu-3.2.dylib -> libwx_baseu-3.2.0.dylib -rwxr-xr-x 1 igorkorot staff 732432 Jul 6 22:16 libwx_baseu_net-3.2.0.0.0.dylib lrwxr-xr-x 1 igorkorot staff 31 Jul 6 22:16 libwx_baseu_net-3.2.0.dylib -> libwx_baseu_net-3.2.0.0.0.dylib lrwxr-xr-x 1 igorkorot staff 27 Jul 6 22:16 libwx_baseu_net-3.2.dylib -> libwx_baseu_net-3.2.0.dylib -rwxr-xr-x 1 igorkorot staff 163636 Jul 6 22:16 libwx_baseu_xml-3.2.0.0.0.dylib lrwxr-xr-x 1 igorkorot staff 31 Jul 6 22:16 libwx_baseu_xml-3.2.0.dylib -> libwx_baseu_xml-3.2.0.0.0.dylib lrwxr-xr-x 1 igorkorot staff 27 Jul 6 22:16 libwx_baseu_xml-3.2.dylib -> libwx_baseu_xml-3.2.0.dylib Igors-MacBook-Air:lib igorkorot$ otool -L libwx_baseu-3.2.dylib libwx_baseu-3.2.dylib: /Users/igorkorot/wxWidgets/buildC11/lib/libwx_baseu-3.2.0.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 158.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0) /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0) /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 492.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.51.6) /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1561.40.112) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1452.23.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 822.31.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1452.23.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) Igors-MacBook-Air:lib igorkorot$

The commands I am running are as follows:

`#Copy and relink wxWidgets base library echo “Copy wxWidgets base library” cp -f ~/wxWidgets/buildC11/lib/libwx_baseu-3.2.dylib "$TARGET_BUILD_DIR/$TARGET_NAME.app/Contents/Frameworks/libwx_baseu-3.2.dylib"

echo “Copy and relink wxWidgets network library” cp -f ~/wxWidgets/buildC11/lib/libwx_baseu_net-3.2.dylib "$TARGET_BUILD_DIR/$TARGET_NAME.app/Contents/Frameworks/libwx_baseu_net-3.2.dylib"

install_name_tool -change ~/wxWidgets/buildC11/lib/libwx_baseu-3.2.dylib @executable_path/../Frameworks/libwx_baseu-3.2.dylib "$TARGET_BUILD_DIR/$TARGET_NAME.app/Contents/Frameworks/libwx_baseu_net-3.2.dylib"

`

But when I tried to verify that, this is the results:

Igors-MacBook-Air:Frameworks igorkorot$ pwd /Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/dbhandler.app/Contents/Frameworks Igors-MacBook-Air:Frameworks igorkorot$ ls -la libwx_base* -rwxr-xr-x 1 igorkorot staff 4524504 Dec 13 21:17 libwx_baseu-3.2.dylib -rwxr-xr-x 1 igorkorot staff 732432 Dec 13 21:17 libwx_baseu_net-3.2.dylib -rwxr-xr-x 1 igorkorot staff 163636 Dec 13 21:17 libwx_baseu_xml-3.2.dylib Igors-MacBook-Air:Frameworks igorkorot$ otool -L libwx_baseu_net-3.2.dylib libwx_baseu_net-3.2.dylib: /Users/igorkorot/wxWidgets/buildC11/lib/libwx_baseu_net-3.2.0.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 158.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0) /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0) /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 492.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.51.6) /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /Users/igorkorot/wxWidgets/buildC11/lib/libwx_baseu-3.2.0.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0) /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork (compatibility version 1.0.0, current version 897.15.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1452.23.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1452.23.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) Igors-MacBook-Air:Frameworks igorkorot$

As you can see nothing changed. The library is still links to the original place, where it was build.

What am I missing?

Thank you for any info.

I'm trying this on macOS High Sierra 10.13.6 with Xcode 9.4.1.

I am trying it on the OSX High Sierra (10.13.6) with Xcode 9.4.1.

Thank you.

Running this in Terminal:

Igors-MacBook-Air:Frameworks igorkorot$ install_name_tool -change ~/wxWidgets/buildC11/lib/libwx_baseu-3.2.dylib ~/dbhandler/dbhandler/Build/Products/Debug/dbhandler.app/Contents/Frameworks/libwx_baseu-3.2.dylib ~/dbhandler/dbhandler/Build/Products/Debug/dbhandler.app/Contents/Frameworks/libwx_baseu_net-3.2.dylib Igors-MacBook-Air:Frameworks igorkorot$ otool -L libwx_baseu_net-3.2.dylib libwx_baseu_net-3.2.dylib: /Users/igorkorot/wxWidgets/buildC11/lib/libwx_baseu_net-3.2.0.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 158.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0) /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0) /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 492.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.51.6) /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /Users/igorkorot/wxWidgets/buildC11/lib/libwx_baseu-3.2.0.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0) /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork (compatibility version 1.0.0, current version 897.15.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1452.23.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1452.23.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) Igors-MacBook-Air:Frameworks igorkorot$

gives the same results, as you can see.

No relinking.

install_name_tool relinking failure
 
 
Q