www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - problem: can not compile anything that uses sockets

reply bobef <bobef_member pathlink.com> writes:
when i try to compile htmlget.d sample
or anything else that use sockets i get alot
symbol undefined errors... i gues i don't
link something right? can someone help me?
(i can compile other programs)
Jul 24 2004
parent Regan Heath <regan netwin.co.nz> writes:
On Sat, 24 Jul 2004 08:02:19 +0000 (UTC), bobef 
<bobef_member pathlink.com> wrote:

 when i try to compile htmlget.d sample
 or anything else that use sockets i get alot
 symbol undefined errors... i gues i don't
 link something right? can someone help me?
 (i can compile other programs)
Try this: dmd htmlget.d wsock32.lib or dmd htmlget.d ws2_32.lib notice the link line it now reads: D:\d\dmd\bin\..\..\dm\bin\link.exe htmlget,,,wsock32.lib+user32+kernel32/noi; instead of: D:\d\dmd\bin\..\..\dm\bin\link.exe htmlget,,,user32+kernel32/noi; by default dmd only links with user32, and kernal32. You need to link with wsock32.lib (winsock v1) or ws2_32.lib (winsock v2) in order to use sockets. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 24 2004