No main() Error

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Feb 5 09:12:55 UTC 2025


On 05/02/2025 9:48 PM, Ron Tarrant wrote:
> On Wednesday, 5 February 2025 at 05:34:09 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>>
>> What you are asking for is a nice customized error message for D.
>>
>> Which as far as I'm aware is not supported by any linker.
> 
> So, what you're saying is that DMD doesn't have its own linker? That 
> never occurred to me.

Not anymore. We did have Optlink for Windows 32bit, but that was written 
in the 80's for C/C++.

> On the other hand, if D uses a linker previously built for other 
> compilers (C or C++, I assume) I'm surprised that this already-existing 
> linker doesn't have such an error message.

It does, when you produce an executable.

All of them have had it since their inception (more or less).

> On the other-other hand, if linkers are used for building both 
> executables and libraries, it does make sense in a way. I mean, 
> otherwise the linker developer would have to allow for a command line 
> switch telling the linker the specific output of the build: library, or 
> executable.

You specify if you want a shared library or executable.

Some will also act as an archiver for static libraries.



More information about the dip.ideas mailing list