how to run two executable generated with different gcc version in same system
===

I have two Executable generated with different gcc version
One is using 3.4.2 and other using 4.3.2 in my Linux box

Both has to be run in same environment ie having same **LD_LIBRARY_PATH**.

Currently path of 4.3.2 is placed before the 3.4.2 the 3.4.2 is giving error.
libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by../../src/hello)

I am thinking about the solution where I can store the information in the exe where to find the
loadtime files needed.

**I created below build scripts which are giving problem:** 

Basically O3 option is doing optimization.

    /opt/gcc-4.3.2/bin/g++ -pipe -O3 -c hello4_3_2.cpp
    /opt/gcc-4.3.2/bin/g++ -o hello4_3_2 hello4_3_2.o -L$/opt/gcc-4.3.2/lib64/libstdc++

    /opt/gcc-3.4.2/bin/g++ -pipe -O3 -c hello3_4_2.cpp
    /opt/gcc-3.4.2/bin/g++ -o hello3_4_2 hello3_4_2.o -L$/opt/gcc-3.4.2/lib64/libstdc++

**Below script works for me:(With out O3 option)**

    /opt/gcc-4.3.2/bin/g++ -pipe  -c hello4_3_2.cpp
    /opt/gcc-4.3.2/bin/g++ -o hello4_3_2 hello4_3_2.o -L$/opt/gcc-4.3.2/lib64/libstdc++

    /opt/gcc-3.4.2/bin/g++ -pipe  -c hello3_4_2.cpp
    /opt/gcc-3.4.2/bin/g++ -o hello3_4_2 hello3_4_2.o -L$/opt/gcc-3.4.2/lib64/libstdc++


**Now:**

1. I wanted to know if there is any other way to achieve it.

2. Is there is any draw back of doing in this way.


Regards,
Vineeth 
