Linking Error (WS2_32.LIB)

mta`chrono chrono at mta-international.net
Thu Nov 10 14:50:59 PST 2011


Am 10.11.2011 20:46, schrieb Walter Bright:
> On 11/9/2011 10:09 AM, Tobse wrote:
>> OPTLINK (R) for Win32  Release 8.00.12
>> Copyright (C) Digital Mars 1989-2010  All rights reserved.
>> http://www.digitalmars.com/ctg/optlink.html
>> dist\client.obj(client)
>>   Error 42: Symbol Undefined _D3std6socket7Address8toStringMFZAya
>> dist\client.obj(client)
>>   Error 42: Symbol Undefined
>> _D3std6socket7Address13addressFamilyMFZE3std6socket1
>> 3AddressFamily
>> dist\client.obj(client)
>>   Error 42: Symbol Undefined _D3std6socket7Address7nameLenMFZi
>> dist\client.obj(client)
>>   Error 42: Symbol Undefined
>> _D3std6socket7Address4nameMFZPS3std1c7windows7winsoc
>> k8sockaddr
>> --- errorlevel 4
> 
> To compile main.d and link with ws2_32.lib,
> 
>    dmd main.d ws2_32.lib
> 
> will work. However, that is not the problem you're having. There's
> clearly a mismatch between the phobos.lib you're linking with and the
> std.socket being read by the compiler. One is out of date with the other.
> 
> In other words, the undefined symbols reported by the linker appear in
> std.socket but do not appear in phobos.lib.

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.

- mta`chrono



More information about the Digitalmars-d mailing list