D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7186 - Only the first exported extern(C) function has underscore prefix
Summary: Only the first exported extern(C) function has underscore prefix
Status: RESOLVED DUPLICATE of issue 3956
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-30 17:04 UTC by Andrej Mitrovic
Modified: 2011-12-31 08:53 UTC (History)
1 user (show)

See Also:


Attachments
DLLExportBug (1.20 KB, application/x-zip)
2011-12-30 17:04 UTC, Andrej Mitrovic
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2011-12-30 17:04:13 UTC
See attachment. When the DLL is built the exported symbols are:

_foo1
foo2
foo3

AFAIK on Windows all exported C functions have an underscore prefix.

You can use DLL Export Viewer to see the symbols: http://www.nirsoft.net/utils/dllexp.zip
Comment 1 Andrej Mitrovic 2011-12-30 17:04:44 UTC
Created attachment 1063 [details]
DLLExportBug
Comment 2 Rainer Schuetze 2011-12-31 01:11:54 UTC
issue 3956 has slightly more info, so I'm closing this one as a duplicate

*** This issue has been marked as a duplicate of issue 3956 ***
Comment 3 Rainer Schuetze 2011-12-31 01:13:55 UTC
Forgot to mention the workaround: list the symbols to export in the linker definition file.
Comment 4 Andrej Mitrovic 2011-12-31 08:53:49 UTC
Thanks for the workaround. I find it amusing that we've used the exact same function names in the sample, lol. :p