[Issue 4581] New: extern function pointers inside functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 4 01:47:43 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4581

           Summary: extern function pointers inside functions
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: link-failure, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2010-08-04 01:47:41 PDT ---
import std.c.windows.windows;

The following code compiles, but does not link:

void main(string[] args) {
    extern (Windows) HINSTANCE ShellExecuteW(HWND, LPCWSTR, LPCWSTR,
        LPCWSTR, LPCWSTR, INT);

    HINSTANCE i = ShellExecuteW(null, "open",
"http://www.example.com", null, null, SW_SHOW);
}

Error 42: Symbol Undefined
__D4test4mainFAAyaZi13ShellExecuteWMWT4core3sys7windows7windows6HANDLEPxuPxuPxuPxuiZT4core3sys7windows7windows6HANDLE at 24

As we can see, the symbol is D mangled, which it should not be.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list