How can I change the libraries that gcc uses when linking with /bin/ld?

view story

http://stackoverflow.com – I'm trying to use a version of gcc relocated from another system to compile something. I know that there are issues with this but if I can get it to work it will make my life much easier. I've added the /opt/transfer/lib path to $LIBRARY_PATH and gcc appears to see this (from gcc -print-search-dirs). I've also added /opt/transfer/lib to /etc/ld.so.conf though I would greatly prefer a solution where this wasn't necessary. The problem comes when I execute: g++ -g -m32 chopper.o -Llibs -lRTS -o Chopper /usr/bin/ld: skipping incompatible /usr/lib/libstdc++.so.6 when searching for /usr/lib/ (HowTos)