gpt4 book ai didi

macos - 如何定义要在 Mac OS X 上使用的库?

转载 作者:IT王子 更新时间:2023-10-29 00:45:49 25 4
gpt4 key购买 nike

我在运行程序时遇到问题,我感觉这是因为 Mac OS X 决定使用错误的库。我希望它使用 SDL_image,但我认为它选择使用 SDL-1.2。有没有办法强制它使用 SDL_image?如果有帮助的话,我正在尝试运行一个用 Go 程序语言编写的程序。

我已经尝试修改 DYLD_LIBRARY_PATH 变量,因为我怀疑 dyld 可能与它有关,但它没有用。我发现的与该问题相关的所有其他内容都只是错误日志,没有说明如何解决它。

objc[96907]: Class SDLTranslatorResponder is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL-1.3.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDLTranslatorResponder is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_ttf-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDL_QuartzView is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_ttf-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDL_QuartzWindowDelegate is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_ttf-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDL_QuartzWindow is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_ttf-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDLTranslatorResponder is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_image-1.2.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDL_QuartzView is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_image-1.2.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDL_QuartzWindowDelegate is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_image-1.2.0.dylib. One of the two will be used. Which one is undefined.
objc[96907]: Class SDL_QuartzWindow is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /usr/local/lib/libSDL_image-1.2.0.dylib. One of the two will be used. Which one is undefined.

最佳答案

您是否尝试过在您的可执行文件上使用 install_name_tool -change 来使库引用具有绝对路径?

您也可以尝试使用 install_name_tool 更改可执行文件的 rpath 并删除/opt/local(如果存在)。或者,如果没有 rpath,您可以尝试添加/usr/local/lib 并更改库引用以使用 @rpath/(参见“man dyld”和“man install_name_tool”)

您也可以从 MacPorts 切换到 Homebrew那么您所有的开源软件都位于/usr/local 下,您就不会遇到此类问题。

关于macos - 如何定义要在 Mac OS X 上使用的库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5849361/

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