I found this code from this page:
http://rosettacode.org/wiki/Category:D
import std.stdio, std.socket;
void main(){
writefln("%s", Socket.hostName());
}
When I tried to build it (I'm on Windows, anyway), I got this:
C:\Users\CSL-NB-064\Codes\D>dmd hostname.d
OPTLINK (R) for Win32 Release 8.00.5
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
ws2_32.lib
Warning 2: File Not Found ws2_32.lib
C:\dmd\lib\phobos.lib(socket)
Error 42: Symbol Undefined _WSAIoctl@36
--- errorlevel 1
I did some Googling, and I found this
http://www.digitalmars.com/d/archives/c++/2519.html. It looked
interesting because MinGW, instead of DMC was used. So I downloaded Jan
Knepper's implib, and extracted it into C:\dm\bin. This is my
implib.ini: http://pastebin.com/iusxakcj
The next part is to build ws2_32.lib I copied ws2_32.dll from
C:\Windows\System32 into C:\dmd\lib, and ran this command:
C:\dm\lib>implib /v /system /IC:\mingw\include /suffix ws2_32.dll ws2_32.dll
The output was:
Digital Mars Import Library Manager Version 7.5B4n
Copyright (C) Digital Mars 1999-2002. All Rights Reserved.
Modified by Jan Knepper
Include Path : 'C:\mingw\include'
Suffix::Include ( C:\mingw\include )
ws2_32.dll
Input is a Windows NT DLL file 'WS2_32.dll'.
cpp.exe: error: unrecognized command line option '-EL'
cpp.exe: error: unrecognized command line option '-EL'
cpp.exe: error: unrecognized command line option '-EL'
cpp.exe: error: unrecognized command line option '-EL'
cpp.exe: error: unrecognized command line option '-EL'
Output is a Windows NT import library.
Digital Mars Import Library Creator complete.
Then I tried to compile once again, and the same error still happened.
Is there an easier way to get the importants libs?