Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
How do I Stop My compiler (VC5.00) from decorating exported function Names, and export them instead without decoration.
Regards,
:)
Posted

You need to prefix the function name with extern "C".
Normally an exported function without name mangling would look like this -
extern "C" __declspec(dllexport) int MyFunction(int, int);

The export could also be done using a .DEF file instead of specifying __declspec(dllexport).
 
Share this answer
 
Comments
Bram van Kampen 8-May-11 7:00am    
I am already using that. However, that still decorates the name with a leading underscore. i.e. Foo() becomes _Foo. How do I loose that leading Underscore.
«_Superman_» 9-May-11 3:16am    
The Microsoft compilers add these name decorations to distinguish between different calling conventions.
The __cdecl calling convention does not add this decoration.
If you want to export without using these decoration irrespective of the calling convention, you must export the functions using a DEF file instead of using __declspec(dllexport).
The only way to remove decorations completely is through def files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900