Bug in OPTLINK?
WeirdCat
sorry at i.hate.spam
Wed Jun 13 11:27:24 PDT 2007
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