www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - listener.d

reply "nobody_" <spam spam.spam> writes:
I think I did something wrong :)
D 1.0

Command >>> Building Project: windows......
C:\D\dm\bin\bud_win_3.04.exe 
listener.d -d -full  -DCPATHC:\D\dmd\bin -Twindows.exe  -odobjs


OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getprotobyname 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getprotobynumber 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getservbyname 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getservbyport 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _WSAGetLastError 0
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _gethostbyname 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _gethostbyaddr 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _inet_addr 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _inet_ntoa 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _ioctlsocket 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getsockopt 20
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _bind 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _connect 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _listen 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _accept 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _closesocket 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _shutdown 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getpeername 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getsockname 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _send 16
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _sendto 24
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _recv 16
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _recvfrom 24
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _setsockopt 20
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _select 20
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _socket 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _WSAStartup 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _WSACleanup 0
Jan 14 2007
next sibling parent Mike Parker <aldacron71 yahoo.com> writes:
nobody_ wrote:
 I think I did something wrong :)
 D 1.0
 

Link with ws2_32.lib
Jan 14 2007
prev sibling next sibling parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
nobody_ wrote:
 I think I did something wrong :)
 D 1.0
 
 Command >>> Building Project: windows......
 C:\D\dm\bin\bud_win_3.04.exe 
 listener.d -d -full  -DCPATHC:\D\dmd\bin -Twindows.exe  -odobjs
 
 
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
 
 C:\D\dmd\lib\phobos.lib(socket)
  Error 42: Symbol Undefined _getprotobyname 4

To use winsock functions you need to link to a special library. IIRC it's ws2_32.lib. Try adding it to the command line, or (since you're using bud) adding 'version(build) { pragma(link, ws2_32); }' in a source file.
Jan 14 2007
prev sibling parent reply "nobody_" <spam spam.spam> writes:
Thanks.
Wouldn't it be handy if that would be noticed in the sourcefile, or am I 
just too new :) 
Jan 14 2007
next sibling parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
nobody_ wrote:
 Thanks.
 Wouldn't it be handy if that would be noticed in the sourcefile, or am I 
 just too new :) 

If you're using std.socket, it's noted right at the top of the documentation[1]: "Notes: For Win32 systems, link with ws2_32.lib." Since that documentation is generated from the source file, it's in there too. In fact, it's in the first comment after the license at the top. If you're using something else (raw Win32 headers, Mango, whatever) please tell us which so whoever maintains 'the sourcefile' can put a note there as well ;). [1]: http://www.digitalmars.com/d/phobos/std_socket.html, or dmd/html/d/phobos/std_socket.html in your DMD installation.
Jan 14 2007
parent reply "nobody_" <spam spam.spam> writes:
listener.d is an example supplied with D.
There is no notice there, but you are totally right that I should have been 
able to find out about that notice on my own :) 
Jan 14 2007
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
nobody_ wrote:
 listener.d is an example supplied with D.
 There is no notice there, but you are totally right that I should have been 
 able to find out about that notice on my own :) 

Ah well I never looked much at the samples :).
Jan 14 2007
prev sibling parent "nobody_" <spam spam.spam> writes:
I thought it would just work... but:
What did I do wrong this ime?

Command >>> ReBuilding Project: windows......
C:\D\dm\bin\bud_win_3.04.exe 
listener.d -d -w -full  -DCPATHC:\D\dmd\bin -Twindows.exe 
C:\D\dmd\lib\WS2_32.LIB -odobjs


OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getprotobyname 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getprotobynumber 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getservbyname 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getservbyport 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _WSAGetLastError 0
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _gethostbyname 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _gethostbyaddr 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _inet_addr 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _inet_ntoa 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _ioctlsocket 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getsockopt 20
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _bind 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _connect 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _listen 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _accept 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _closesocket 4
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _shutdown 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getpeername 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getsockname 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _send 16
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _sendto 24
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _recv 16
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _recvfrom 24
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _setsockopt 20
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _select 20
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _socket 12
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _WSAStartup 8
C:\D\dmd\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _WSACleanup 0


Finished
Jan 15 2007