Preventing name mangling of exported symbols in a c++ file
Preventing name mangling of exported symbols in a c++ file
- Subject: Preventing name mangling of exported symbols in a c++ file
- From: Matt Gough <email@hidden>
- Date: Tue, 3 Jan 2006 16:36:54 +0000
I am trying to convert a Framework project of mine from CodeWarrior
to XCode.
In CodeWarrior, my .h and .cp files are akin to this:
PublicStuff.h
#ifdef __cplusplus
extern "C" {
#endif
void SomeFunction(const UInt32 value);
#ifdef __cplusplus
}
#endif
end of PublicStuff.h
PublicStuff.cp
#pragma export on
void SomeFunction(const UInt32 value)
{
// real code goes here
}
#pragma export off
End of PublicStuff.cp
In CodeWarrior, the function names do not get mangled, but in XCode
they appear to be.
As Xcode does not support #pragma export, I am using an Exported
Symbols File. However at link time, it tells me that it
ld: symbols names listed in -exported_symbols_list:
Exported_Symbols.txt not in linked objects
Doing a disassembly of PublicStuff.cp shows that all my names have
indeed been mangled.
I tried wrapping PublicStuff.cp itself in a extern "C" { } block, but
to no affect.
How do i fix this?
BTW - Xcode 2.2, gcc 4
Matt Gough
Softchaos Limited
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden