delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/09/07:09:24

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <F562D0DC54E1D211B2A6009027465034D62475@exchange>
From: Ben Miller <Ben DOT Miller AT Mercia DOT Com>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Leading underscore in export names.
Date: Fri, 9 Mar 2001 12:05:00 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

Hi,

I have a function declared like this:

extern "C" __declspec(dllexport) void __stdcall foo()
{
}

When I build this into a DLL using the Visual C++ compiler (cl.exe),
the exported name is:

_foo AT 0

but when I build it using the GNU C++ compiler (g++), the exported
name is:

foo AT 0

Which one is correct?  I have read that the stdcall convention should
prepend an underscore to exported names - should the extern "C"
qualifier remove it?

Regards,
Ben.

Mercia Software Ltd.
Mercia House 
Ashted Lock
Aston Science Park
Birmingham B7 4AZ, UK 
Registered Number: 1868855 (Cardiff) 
Tel: 44 (0)121 359 5096 
Fax: 44 (0)121 359 0375 
Web Site: http://www.mercia.com 




--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019