Bug in OPTLINK?

David L. Davis SpottedTiger at yahoo.com
Wed Jun 13 12:46:34 PDT 2007


WeirdCat,

    I commented in the "pragma(lib, "Ws2_32.lib");" line in testme.d, but left it in C:\dmd\test\win32\winsock2.d...and then just added the win32\winsock2.d parameter to the commandline (dmd testme.d win32\winsock2.d). It still compiles in my tests...maybe the linker's path is missing in your environment "Path" variable.

David L.

WeirdCat Wrote:

> David L. Davis Wrote:
> >    I did the follwing below and it compiles fine with dmd v1.015 on WinXP SP2 (32-bit)...so I don't think it's the linker.
> 
> Try it without uncommenting the 2 lines and with the command:
> 
>     dmd test.d lib\win32.lib
> 
> Result:
> test.obj(test)
>  Error 42: Symbol Undefined _WSAGetLastError at 0
> 
> test.d includes win32.winsock2 and the "pragma(lib, "Ws2_32.lib");" in winsock2.d should tell the linker to include Ws2_32.lib, but it doesn't (only exception from that is if you uncomment line 6 in test.d).
> If you manualy include Ws2_32.lib a) via command line "dmd test.d lib\win32.lib Ws2_32.lib" or b) via uncommenting "pragma(lib, "Ws2_32.lib");" (line 3) it works. But you shouldn't have to do it. Therefore I think there is a subtle bug in the linker.
> 
> LLAP,
> Sascha



More information about the Digitalmars-d-learn mailing list