dotws86260
2011-05-01 15:33
浏览 96

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

I'm having trouble getting a program to work, and I have a feeling it is because Mac OS X has decided to use the wrong library. I want it to use SDL_image, but I think its choosing to use SDL-1.2 instead. Is there a way to force it to use SDL_image? If it helps at all, I'm trying to run a program written in the Go program language.

I've tried modifying the DYLD_LIBRARY_PATH variable because I suspect dyld might have something to do with it, but it didn't work. Everything else I've found relating to the problem is just error logs that say nothing about how to fix it.

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.

图片转代码服务由CSDN问答提供 功能建议

我无法使程序正常运行,并且感觉是因为Mac OS X已决定 使用错误的库。 我希望它使用SDL_image,但我认为它选择使用SDL-1.2。 有没有办法强迫它使用SDL_image? 如果有帮助,我正在尝试运行以Go程序语言编写的程序。

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

  objc [96907]:在/ opt中都实现了SDLTranslatorResponder类 /local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL-1.3.0.dylib。 将使用两者之一。  
objc [96907]:类SDLTranslatorResponder在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_ttf-2.0.0.dylib中实现。 将使用两者之一。  
objc [96907]:类SDL_QuartzView在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_ttf-2.0.0.dylib中都实现。 将使用两者之一。  
objc [96907]:类SDL_QuartzWindowDelegate在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_ttf-2.0.0.dylib中都实现。 将使用两者之一。  
objc [96907]:类SDL_QuartzWindow在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_ttf-2.0.0.dylib中都实现。 将使用两者之一。  
objc [96907]:类SDLTranslatorResponder在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_image-1.2.0.dylib中都实现。 将使用两者之一。  
objc [96907]:类SDL_QuartzView在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_image-1.2.0.dylib中都实现。 将使用两者之一。  
objc [96907]:类SDL_QuartzWindowDelegate在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_image-1.2.0.dylib中都实现。 将使用两者之一。  
objc [96907]:类SDL_QuartzWindow在/opt/local/lib/libSDL-1.2.0.dylib和/usr/local/lib/libSDL_image-1.2.0.dylib中都实现。 将使用两者之一。 哪个未定义。
   
 
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doushi8187 2011-06-19 12:28
    已采纳

    Have you tried using install_name_tool -change on your executable to make the library references have absolute path?

    You could also try using install_name_tool to change the rpath for the executable and remove /opt/local if it is there. Or if there is no rpath you could try adding /usr/local/lib and -change the library references to use @rpath/ (see "man dyld" and "man install_name_tool")

    You could also switch from MacPorts to Homebrew then all your open-source software lives under /usr/local and you don't get into this sort of problem.

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题