Mail Archives: djgpp/1996/05/14/21:33:35
Roland Nilsson (roland DOT nilsson AT communique DOT se) wrote:
: Hi comp.os.msdos.djgpp!
: (Sorry if this is a common question, but I couldn't find an answer
: in any docs or faqs.)
: I have a problem with djgpp v2 object output: it renders strange symbol
: names for my functions. Function "foo()" renders "_foo__FPc" or
: "_foo__FPec", not just "_foo". Why? Can this be controlled by an option?
This is called C++ name mangling. The problem is that you can have the same
function name with different parameter/return value types and the proper
function is called depening of the types. To make the linker distinguish
the different functions, the types are somehow encoded into the function
names. (In a reversible manner, I think, the debugger, nm etc can correctly
list the functions).
If this is now what you want (i.e. you want to write a C function in a C++
program), you can declare the function extern "C" before, then it is called
normally (for the proper syntax, take a look at any of the header files).
bye, Alexander
--
Alexander Lehmann, | "On the Internet,
alex AT hal DOT rhein-main DOT de (plain, MIME, NeXT) | nobody knows
alexlehm AT rbg DOT informatik DOT th-darmstadt DOT de (plain) | you're a dog."
<URL:http://www.student.informatik.th-darmstadt.de/~alexlehm/>
- Raw text -