[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Name mangling



Eelke Klein wrote:

> Someone noted that C++ does namemangling and that the namemangling is
> different when using different compilers. This would mean that all code
> would have to be compiled with the same compiler.
>
> Any comments about this, is it true, is it a problem?

Some compilers even have different name mangling schemes accross versions.
So yes it is true.

If it is a problem depends on what you want to do. You can always use plain
C stubs to work around this problem like this:

extern "C" {
    void my_func () { }
}

If you just want to compile several C++ classes with several compilers than
you will most likely have problems.


Greetings,

--
==============================================================================
Jorrit.Tyberghein@uz.kuleuven.ac.be, University Hospitals KU Leuven BELGIUM

Rincewind had been told that death was just like going into another room.
The difference is, when you shout, "Where's my clean socks?", no-one
answers.
        -- (Terry Pratchett, Eric)
==============================================================================