Hi,
to import a dylib on mac, the code works if the dylib is in the same directory as the pb-file.
If I compile this pb to an app, in which subdirectory I have to copy the dylib?
Thanks.
Import : EndImport - path?
Re: Import : EndImport - path?
Lebostein wrote:to import a dylib on mac, the code works if the dylib is in the same directory as the pb-file.
If I compile this pb to an app, in which subdirectory I have to copy the dylib?
- Copy the dylib into "YourAppName.App/Contents/MacOS/"
or into a subdirectory within this folder, for example "YourAppName.App/Contents/MacOS/lib/" - Now run the command:
If you installed into lib/ subdirectory, you write
Code: Select all
install_name_tool -change YourDylibName.dylib @executable_path/YourDylibName.dylib ./YourAppName.App/Contents/MacOS/YourAppName
(replace "YourAppName" and "YourDylibName" with your own names. Do not replace "@executable_path", it is written like that)Code: Select all
install_name_tool -change YourDylibName.dylib @executable_path/lib/YourDylibName.dylib ./YourAppName.App/Contents/MacOS/YourAppName
- Verify the changed dylib path by running:
It should output "@executable_path/" in front of your dylib name, whereas before the change it just displayed the dylib name without a path
Code: Select all
otool -L ./YourAppName.App/Contents/MacOS/YourAppName
Re: Import : EndImport - path?
Thank you! I will try it.