Re: Difference in mangling

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 07/29/03


Date: Tue, 29 Jul 2003 14:35:50 GMT

In article <bg5ulc$l8v4q$1@ID-197517.news.uni-berlin.de>,
lomat <atambe@ideas.com> wrote:
>In short, (as mangling is compiler dependent) my compiler is mangling the
>symbols in a way different from the compiler that was used to build the
>library I am trying to link to. As a result I am getting an un-resolved
>symbol error. How do I solve this?

In general you can't link object files that were compiled with different
C++ compilers. The layout of classes and the calling sequence of member
functions is likely to be different. The different mangling is on purpose,
to prevent you from accidentally linking together incompatible code.

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


Relevant Pages

  • Re: Fortran 90 modules suck for portability- why use them?
    ... it is clear that I am talking about name mangling. ... of the various flags gfortran has for name mangling; PathScale has the ... name mangling was perhaps inherited from g95 (the other OSS compiler) ...
    (comp.lang.fortran)
  • Re: extern "C" ... again
    ... There is no standard or convention on how and when to use name ... mangling. ... It is up to the "producer" of compiler and linker to decide. ...
    (microsoft.public.vc.language)
  • Re: Headers!
    ... >>anywhere an explanation of what are .h files and how to write them. ... Note that extern "C" isn't just about name mangling; ... One thing it doesn't do is to cause a C++ compiler to interpret ...
    (alt.comp.lang.learn.c-cpp)
  • Re: interface blocks
    ... Name mangling is part of life in the C++ world. ... every compiler on a given platform mangles ... with name mangling the error is not found until link time instead ... Personally I use the word linker when refering to the last step ...
    (comp.lang.fortran)
  • Re: Translating OO program to procedural program
    ... effort can be spreaded out to other langs, so I am working on to ... later by the procedural lang compiler. ... About C++, you should have a look at method name mangling, (google for ... of C), and CLOS (Common Lisp). ...
    (comp.compilers)