Xcode doesn't link my 3rd party dylibs post build

I'm developing a cross plaform application and am using Xcode to build the MacOS executable. I have it building and running on my machine with the 3rd party dynamic libraries placed in /opt/homebrew (as installed by brew), but obviously when I move to another machine it doesn't work

Within Xcode i've added my 3rd party dependencies to Frameworks, Libraries and Embedded content within my target. After the build, these are copied to Contents/Frameworks as I expect but the executable is not linked to these dylibs but the ones in /opt/homebrew

I read around the forums here and set dynamic library install name = @rpath/$(EXECUTABLE_PATH) and runpath search path = @executable_path/../Frameworks but this doesn't fix my issue

While I'm confident working with other platforms, this is my first time developing for MacOS, I've only been a Mac user for ten months so i know this is an easy fix its just something I'm missing

Answered by DTS Engineer in 773317022

Have a read of my Dynamic Library Identification and the Dynamic Library Standard Setup for Apps post it references. It explains how rpath-relative paths are expected to work. I think that’ll get you on the right path but, if not, post back here with your specific questions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Have a read of my Dynamic Library Identification and the Dynamic Library Standard Setup for Apps post it references. It explains how rpath-relative paths are expected to work. I think that’ll get you on the right path but, if not, post back here with your specific questions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Xcode doesn't link my 3rd party dylibs post build
 
 
Q