Hi everyone. Sorry if this is not an appropriate forum section for this question. I'm making a game engine and it doesn't launch on my colleague's MacBook, although it does launch on mine. There's an application file, let's say, Sample.app. And along with it in the same folder there's Engine.dylib. If we look at the app-file structure, the executable file's path is Contents/MacOS/Sample. So for the executable file the library is located at the path ../../../Engine.dylib. But when my colleague runs the Sample.app file, he gets an error "Library not loaded: @executable_path/../../../Engine.dylib". Although the path is correct and on my MacBook it works. Are there any ideas how to fix it?
Launching an app from Finder
How are you building your app? Using Xcode? Using Apple tools from the command line? Or using a third-party tool?
That matters because the best path forward is very different if you’re using Xcode than if, say, you’re using a third-party IDE.
Also, and this is just an FYI at this point, referencing a library using @executable_path/../../../Engine.dylib
is rarely the best option. In most cases you want to use an rpath-relative path. I talk about this issue in some detail in Dynamic Library Identification > Dynamic Library Standard Setup for Apps.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Thank you for the reply. I'm building the app using Xcode The parameters in settings are Dynamic Library Install Name - @executable_path/../../../Engine.dylib Dynamic Library Install Name Base - @executable_path/../../../