comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve Doiel" <nospam_steved@pacifier.com>
Subject: Re: GNAT sockets
Date: 1998/12/30
Date: 1998-12-30T00:00:00+00:00	[thread overview]
Message-ID: <368af3c7.0@news.pacifier.com> (raw)
In-Reply-To: 368a76d8.0@dial-in.encomix.es


Daniel Fanjul wrote in message <368a76d8.0@dial-in.encomix.es>...
>Hello,
>
>I wrote this code to be compiled with GNAT (for Windows 95):
>
>    #include "windows.h"
>    #include "windows32\sockets.h"
>
>    int main () {
>        SOCKET s;
>
>        s = socket (AF_INET, SOCK_STREAM, 0);
>        printf ("%d", s);
>        return 0;
>    }
>
>The output was -1.
>
>Can anybody help me?
>
Yes.

You need to call WSAStartup before any of the Win32 socket stuff will work
at all.
You'll have to find this in the Win32 documentation since it is Win32
specific (no such call is required under UNIX).

SteveD







  parent reply	other threads:[~1998-12-30  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-29  0:00 GNAT sockets Daniel Fanjul
1998-12-30  0:00 ` dennison
1998-12-30  0:00 ` Steve Doiel [this message]
1998-12-30  0:00 ` David Botton
1998-12-31  0:00 ` robert_dewar
1999-01-01  0:00 ` Jerry van Dijk
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox