multiple version of gcc

Hello, i installed gcc47 and gcc49 from pkg install and in order to compile with gcc49 i made a symlink in /usr/local/bin which goes to gcc49. But when I run the program I get :

/usr/local/lib/gcc47/ version GLIBCXX_3.4.20 required by MyProgram

I would like to run the program with the lib of gcc49, if someone could help me I would be gratefull.
Thanks in advance.
Last edited by a moderator:
To ensure binaries built with this toolchain find appropriate versions
of the necessary run-time libraries, you may want to link using