Cannot find libstdc++ but it is there in the LD_LIBRARY_PATH
Hello, Dear fellows, I have installed intel compilers on a Red Hat Linux x86_64 machine. I did the require step of source /intel/compilervars.csh intel64. The icpc and ifort works as they should, I can compile a small test program without a problem. However, when I tried icc to compile the exact program( a c program) that worked for icpc, I got a weird error: ld: cannot find -lstdc++ However, after I locate the libstdc++, it is in the LD_LBRARY_PATH. And all other compilers(icpc, gcc,g++) haven't complained about missing lstdc++. Using icc -v test.c, I got:
I have the gnu libstdc++.so.5 inside /usr/lib and /usr/lib64. Clearly in the ld command icc called, it has a flag -L/usr/lib64 and -L/usr/lib, so it should search /usr/lib and /usr/lib64. Why would icc complain about cannot find -lstdc++ then? I installed the compiler in a similar machine without any problem. I will really appreciate if someone can help me with this headache.