icpc doesn't find -lstdc++, but gcc does

icpc doesn't find -lstdc++, but gcc does

I am trying to link in a package of code that requires you add -lstdc++ to the link step. If I use gcc, it links fine, but if I use icpc it is not finding libstdc++. Can anyone explain what the difference is? I thought both compilers were using ld to do the link.

Thanks for any insight,
Mary Monahan

9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Current Intel compilers don't support libstdc++. The C++ libraries are included by default, just as they would be if g++ were used to link. If the build setup isn't too gcc-specific, it should work without -lstdc++.

Without -lstdc++, I am getting a lot of undefined references like the following:
nsiint.o(.text+0x276): undefined reference to `__builtin_new'
nsiint.o(.text+0x2a5): undefined reference to `__throw'
nsiint.o(.text+0x2be): undefined reference to `__builtin_delete'
nsiint.o(.text+0x361): undefined reference to `terminate(void)'
nsiint.o(.text+0x1a49): undefined reference to `__builtin_vec_new'
nsiint.o(.text+0x1c0e): undefined reference to `__builtin_vec_delete'
dlistcol.o(.text+0x24d): undefined reference to `__cp_eh_info'
dlistcol.o(.text+0x260): undefined reference to `__uncatch_exception'
dlistcol.o(.text+0x283): undefined reference to `__cp_pop_exception'
dlistcol.o(.text+0x30d): undefined reference to `__cp_eh_info'
dlistcol.o(.text+0x343): undefined reference to `__cp_pop_exception'

Does this mean we can't use the Intel compiler? The product we are trying to link with is available on many platforms. I find it unlikely that it is "gcc specific".

Mary Monahan

Hello Mary,
I think files are not cleanly compiled with Intel compiler. All these definitions are present only in gcc v2 libraries. These are not defined even in g++ v3 libs.

Could you please try these steps -
- delete nsiint.o, dlistcol.o .. etc and
- compile one of them from command line with Intel compiler.
- do nm .o (above generated object file)
- attach the results of above command to this issue.


I'd love to. But the *.o files that are complaining are in libraries shipped with the product I am trying to use. I don't have the source. Are you saying that in this case the Intel Compiler is not compatible with these gcc compiled objects?


Currently, the Intel compiler is not binary compatible with C++ files compiled with g++. You cannot take object files or library files compiled with g++ and link them in an application with C++ files compiled with icpc. This is a very important goal for the Intel compiler, and we are working on this for future releases. Our gcc compatibility paper describes this in detail: http://www.intel.com/software/products/compilers/techtopics/LinuxCompilersCompatibility.htm

The Intel Compiler has full binary compatibility with C langauge files built with gcc (such as glibc, the C language library).


Message Edited by intel.software.network.support on 12-09-2005 01:38 PM

As CP pointed out, you are trying to link object files which aren't compatible with current g++. Those files would have to be rebuilt from source in order to link with compilers which adhere to the standard ABI, including g++-3.x or a future icc. Linux distributions are likely to support this type of backward compatibility for a time, but only when using the old 2.9 series gcc.

I'm a little confused by your response. cp_jain's append above implied these modules were compiled with gcc, not g++:

"I think files are not cleanly compiled with Intel compiler. All these definitions are present only in gcc v2 libraries. These are not defined even in g++ v3 libs."

I am going to try to get build information from the library supplier. Their docs only state a requirement for "GCC 2.95.2 compiler for 32-bit".

I read what appeared to be the applicable sections in your paper. Unfortunately, since I don't have the explicit build information for the binaries in question, it is hard to tell when the restrictions apply.

Yes, exactly, gcc/g++ v2.95 compiled libraries are not compatible with Intel compiler.
Even gcc/g++ v3.x libs are not compatible with older versions of GNU compilers.

Could you please ask the library supplier to build it using Intel compiler or newer versions of GNU compilers.

And regarding this statement of my earlier reply -
>>"I think files are not cleanly compiled with Intel >>compiler. All these definitions are present only in gcc >>v2 libraries. These are not defined even in g++ v3 >>libs."

I meant GNU (gcc or g++) v3 libs. I apologize for not mentioning this clearly in my earlier reply.


Leave a Comment

Please sign in to add a comment. Not a member? Join today