www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10034] New: wWinMain and wmain fail to link

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10034

           Summary: wWinMain and wmain fail to link
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optlink
        AssignedTo: nobody puremagic.com
        ReportedBy: diggsey googlemail.com


--- Comment #0 from Diggory <diggsey googlemail.com> 2013-05-05 13:44:50 PDT ---
Fairly self explanatory, unicode versions of WinMain and main cause a bunch of
undefined symbol errors such as:

Error 42: Symbol Undefined _D15TypeInfo_Struct6__vtblZ

Followed by the message:

OPTLINK : Warning 134: No Start Address

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 05 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10034


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-05-05
13:55:40 PDT ---
Unicode version, what do you mean? AFAIK there's only one possible win main
function called WinMain.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10034



--- Comment #2 from Diggory <diggsey googlemail.com> 2013-05-05 14:12:24 PDT ---
Windows also supports "wmain" and "wWinMain" which are wide character versions
of "main" and "WinMain".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 05 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10034


Simen Kjaeraas <simen.kjaras gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras gmail.com


--- Comment #3 from Simen Kjaeraas <simen.kjaras gmail.com> 2013-05-05 15:33:02
PDT ---
Windows supports neither WinMain nor wWinMain. Windows supports a starting
address. MSVC, on the other hand, supports both WinMain and wWinMain. According
to documentation, WinMain is the official entry point, and wWinMain is magical,
in that it creates a thunk that calls GetCommandLineW and passes that to
wWinMain.

DMD would thus be free to call its Unicode version of WinMain wWinMain,
WinSecondary, foo, or anything else (same goes for the ANSI version). It could
even (gasp!) call it WinMain, and create a thunk if the parameters indicate it
should be using Unicode.

See remarks here:
http://msdn.microsoft.com/en-us/library/ms633559.aspx

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