Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7680 Discussions

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:

ld /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/crtbegin.o --eh-frame-hdr -dynamic-linker /lib64/ -o a.out -L/home/yi/intel/composerxe-2011.2.137/compiler/lib/intel64 -L/home/yi/intel/composerxe-2011.2.137/compiler/lib/intel64 -L/home/yi/intel/composerxe-2011.2.137/ipp/../compiler/lib/intel64 -L/home/yi/intel/composerxe-2011.2.137/ipp/lib/intel64 -L/home/yi/intel/composerxe-2011.2.137/compiler/lib/intel64 -L/home/yi/intel/composerxe-2011.2.137/mkl/lib/intel64 -L/home/yi/intel/composerxe-2011.2.137/tbb/lib/intel64//cc4.1.0_libc2.4_kernel2.6.16.21 -L/home/yi/intel/composerxe-2011.2.137/compiler/lib/intel64 -L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.0 -L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/home/yi/intel/composerxe-2011.2.137/compiler/lib/intel64 -L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../.. -L/lib64 -L/lib -L/usr/lib64 -L/usr/lib /tmp/iccywrHUM.o -Bstatic -limf -lsvml -Bdynamic -lm -Bstatic -lipgo -ldecimal --as-needed -Bdynamic -lcilkrts -lstdc++ --no-as-needed -lgcc_s -lgcc -Bstatic -lirc -Bdynamic -lc -lgcc_s -lgcc -Bstatic -lirc_s -Bdynamic -ldl -lc /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/crtend.o /usr/lib/../lib64/crtn.o
ld: cannot find -lstdc++

I have the gnu 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.

0 Kudos
1 Reply
Black Belt
Recent Intel icpc requires, which ought to be provided with g++-4. development installation. Such a g++ must be active on PATH when running an Intel linux or Mac compiler.