From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3858a89a714886ac X-Google-Attributes: gid103376,public From: "Steve Doiel" Subject: Re: GNAT sockets Date: 1998/12/30 Message-ID: <368af3c7.0@news.pacifier.com>#1/1 X-Deja-AN: 427340732 References: <368a76d8.0@dial-in.encomix.es> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Trace: 30 Dec 1998 19:47:19 PST, 216.65.141.181 Newsgroups: comp.lang.ada Date: 1998-12-30T00:00:00+00:00 List-Id: 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