Linking Error (WS2_32.LIB)

Nick Sabalausky a at a.a
Thu Nov 10 17:10:42 PST 2011


"Walter Bright" <newshound2 at digitalmars.com> wrote in message 
news:j9hp3g$aqd$1 at digitalmars.com...
> On 11/10/2011 2:50 PM, mta`chrono wrote:
>> Walter, have you looked into his source. What he did was:
>>
>> --------- BEGIN ----------
>> import std.socket;
>>
>> class FoobarAddress : Address
>> {
>>
>> }
>>
>> void main()
>> {
>>
>> }
>> ---------- END ---------
>>
>> compile this with dmd -m32 main.d and you'll see exactly the same errors
>> that he posted. Even tough dmd's error message are a little bit
>> confusing in this case, the problem should be clear.
>
> You're right.
>
> And the problem is that Address is an *abstract* class, defined as:
>
> abstract class Address
> {
>     protected sockaddr* name();
>     protected int nameLen();
>     AddressFamily addressFamily();
>     override string toString();
> }
>
> This means that anyone deriving from it needs to implement those 
> functions.

Isn't this a bug that the compiler accepted it and the error didn't get 
raised until it got all the way to the linker? Doesn't the compiler normally 
catch that before it gets to the linker?




More information about the Digitalmars-d mailing list