gpt4 book ai didi

cocoa - 将路径设置为 Cocoa 应用程序中的 .dylib 路径

转载 作者:行者123 更新时间:2023-12-03 18:05:55 24 4
gpt4 key购买 nike

我正在开发一个 Mac OS X Cocoa 应用程序,并且想要使用多个 .dylib 库。如何设置位于我的应用程序文件夹中某处的 .dylib 的路径?如果该路径位于不同计算机上的不同目录中或者根本不存在怎么办?

最佳答案

which resides somewhere in my Application folder?

使用@rpath。 (或@executable_path。)请参阅man 1 dyld .

What if the path resides in different directories on different computers or is not existent at all?

那么您的应用程序将无法加载。使用weak linking或者如果 dylib 不是必需的,则在运行时使用 dlopen 加载 dylib。

关于cocoa - 将路径设置为 Cocoa 应用程序中的 .dylib 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2387194/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com