This is the mail archive of the
cygwin-talk
mailing list for the cygwin project.
Re: --add-stdcall-alias equivalent for Visual-C++ ?
- From: Jim Kleckner <jek-cygwin2 at kleckner dot net>
- To: The Vulgar and Unprofessional Cygwin-Talk List <cygwin-talk at cygwin dot com>
- Date: Sat, 31 May 2008 13:12:34 -0700
- Subject: Re: --add-stdcall-alias equivalent for Visual-C++ ?
- References: <48419168.5090606@kleckner.net>
- Reply-to: The Vulgar and Unprofessional Cygwin-Talk List <cygwin-talk at cygwin dot com>
Jim Kleckner wrote:
An off-topic request:
The --add-stdcall-alias argument to ld exports symbols as both
"decorated" (with leading _ and trailing @nn) and "undecorated".
Anyone know of the easiest way to get VC++ to do this?
Yes, a manual exports .def file can be created (or semi-automated).
But it is so nice that ld does this which is needed for Excel or other
DLL-consuming Windoze programs.
FYI, after searching and trying lots of hacks, I came up with
including a "pragma comment" as the easiest way to manage
this requirement. Microsoft doesn't appear to want to make
this easy the way gcc/ld does.
Something like:
#pragma comment(linker, "/EXPORT:func1=_func1@4")