如何定义在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.

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.