www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - std.socket broken

reply a.c.edwards <a.c.edwards_member pathlink.com> writes:
The socket module is missing a few helper functions. Attempts to use it
generated the following errors: 

c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _getprotobyname 4  
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _getprotobynumber 4
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _getservbyname 8   
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _getservbyport 8   
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _WSAGetLastError 0 
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _gethostbyname 4   
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _gethostbyaddr 12  
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _inet_addr 4       
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _inet_ntoa 4       
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _ioctlsocket 12    
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _getsockopt 20     
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _bind 12           
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _connect 12        
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _listen 8          
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _accept 12         
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _closesocket 4     
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _shutdown 8        
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _getpeername 12    
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _getsockname 12    
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _send 16           
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _sendto 24         
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _recv 16           
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _recvfrom 24       
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _setsockopt 20     
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _WSAStartup 8      
c:\dmd\bin\..\lib\phobos.lib(socket)           
Error 42: Symbol Undefined _WSACleanup 0    
Jun 04 2005
next sibling parent "Regan Heath" <regan netwin.co.nz> writes:
On Sat, 4 Jun 2005 15:29:04 +0000 (UTC), a.c.edwards  
<a.c.edwards_member pathlink.com> wrote:
 The socket module is missing a few helper functions. Attempts to use it
 generated the following errors:

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

These functions are in the C/C++ wsock32.lib file. Eg. [test.d] import std.socket; void main() { TcpSocket s = new TcpSocket(); } Must be compiled with the command line: dmd test.d wsock32.lib Regan
Jun 04 2005
prev sibling parent reply Vathix <vathix dprogramming.com> writes:
On Sat, 04 Jun 2005 11:29:04 -0400, a.c.edwards  
<a.c.edwards_member pathlink.com> wrote:

 The socket module is missing a few helper functions. Attempts to use it
 generated the following errors:

 c:\dmd\bin\..\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getprotobyname 4

Link with ws2_32.lib: dmd myapp.d ws2_32.lib It's written on the documentation page but can be hard to find.
Jun 04 2005
parent reply Chris Sauls <ibisbasenji gmail.com> writes:
You know I wonder -- could pragma(lib) be used to detour around this 
common accident?  Or would it be bad to have any parts of Phobos using 
pragma(lib)?

-- Chris Sauls

Vathix wrote:
 On Sat, 04 Jun 2005 11:29:04 -0400, a.c.edwards  
 <a.c.edwards_member pathlink.com> wrote:
 
 The socket module is missing a few helper functions. Attempts to use it
 generated the following errors:

 c:\dmd\bin\..\lib\phobos.lib(socket)
 Error 42: Symbol Undefined _getprotobyname 4

Link with ws2_32.lib: dmd myapp.d ws2_32.lib It's written on the documentation page but can be hard to find.

Jun 04 2005
parent Mike Parker <aldacron71 yahoo.com> writes:
Chris Sauls wrote:
 You know I wonder -- could pragma(lib) be used to detour around this 
 common accident?  Or would it be bad to have any parts of Phobos using 
 pragma(lib)?

I like it. That means things would just work. And adding a pragma to to std.loader so that it can link with ld on Linux would allow it to finally be compiled into Phobos on Linux. Though I still think it needs a bit of an overhaul.
Jun 04 2005