D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13984 - Mangling of /ENTRY depends on DLL imports
Summary: Mangling of /ENTRY depends on DLL imports
Status: RESOLVED MOVED
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: x86 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: link-failure, mangling
Depends on:
Blocks:
 
Reported: 2015-01-15 12:59 UTC by Vladimir Panteleev
Modified: 2020-04-09 08:35 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2015-01-15 12:59:20 UTC
///////////// test.d ////////////
extern(System) uint GetVersion();

void main()
{
//    GetVersion();
}
/////////////////////////////////

This program compiles and links fine with the command:

dmd -L/ENTRY:_mainCRTStartup test.d 

However, if you uncomment the GetVersion line, linking breaks:

OPTLINK (R) for Win32  Release 8.00.15
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 180: No Match Found for Export/ENTRY -  : _mainCRTStartup
--- errorlevel 1

To fix linking, the leading underscore needs to be removed from the command line:

dmd -L/ENTRY:mainCRTStartup test.d
Comment 1 Mathias LANG 2020-04-09 08:35:01 UTC
Moved to OPTLINK Github repository: https://github.com/DigitalMars/optlink/issues/29