wilzbach / tools-test

1 stars 0 forks source link

Mangling of /ENTRY depends on DLL imports #121

Open wilzbach opened 9 years ago

wilzbach commented 9 years ago

Note: the issue was created automatically migrated from https://issues.dlang.org

Original bug ID: BZ#13984 From: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> Reported version: D2 CC: bugzilla@digitalmars.com

wilzbach commented 9 years ago

Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net>

///////////// 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