[Issue 2764] Skip link if main not found

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 28 21:16:02 PDT 2009


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


unknown at simplemachines.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |unknown at simplemachines.org




------- Comment #3 from unknown at simplemachines.org  2009-03-28 23:16 -------
(In reply to comment #1)
> I thought some more about this, and there's a problem. A module may not have a
> main(), but it may reference another function in a library that does have a
> main().

I think this is an important use-case.

More specifically, things like WinMain(), etc.  DMD doesn't special-case those
for you, so it's likely a framework/toolkit might write your WinMain for you
and give you a D function to hook in.  Although I'd do that with a template,
myself.

The best solution would be altering the linker, just so slightly, to output an
easier to understand message than "no start address."  As exactly correct as
this message may be, programmers more interested in application programming
than systems programming may be very perplexed.

That said, the most common case is when compiling with new libs - just the
default.  Maybe a solution is to show this error whenever no libs are passed
in, and add a switch (beside defaultlib) to suppress the error for other
default libraries?  It is only to improve documentation, after all.

-[Unknown]


-- 



More information about the Digitalmars-d-bugs mailing list