www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13984] New: Mangling of /ENTRY depends on DLL imports


          Issue ID: 13984
           Summary: Mangling of /ENTRY depends on DLL imports
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P1
         Component: Optlink
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

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

dmd -L/ENTRY:mainCRTStartup test.d

Jan 15 2015