c++.windows.32-bits - Which header files for using socket(), etc. on windows?
- Paul M. (41/41) May 11 2007 I've tried all day and I can't get the WINSOCK2.H file to even be
- Bertel Brander (21/28) May 11 2007 Try:
I've tried all day and I can't get the WINSOCK2.H file to even be acceptable. Do I need special switches or other header files? I've tried all kinds of combinations. I've done this stuff under UNIX and with a library for the TI DSP's. They were easy. Any help greatly appreciated. Feel free to point me to some example pages or such. Paul begin 644 socket_scs.c M"B-I;F-L=61E(#Q724Y33T- /=&,N+BX *B\-"GT-" T* ` end begin 644 make.log M9&UC("UC("U!("UR("UI+B`M1%=)3C,R("U$7VEN;&EN93UI;FQI;F4 ;6%I M:6YE('-O8VME=%]S8W,N8PT*455%4EE(04Y$3$52("A,4%9/240 :V5Y8V]N M=&5X="P 4%9!3$-/3E1%6%0 =F%L7VQI<W0L($173U)$(&YU;5]V86QS+`T* M14<N2" X.2D .B!%<G)O<CH ;6ES<VEN9R`G+"< 8F5T=V5E;B!D96-L87)A M=&EO;B!O9B`G7V-D96-L)R!A;F0 )U%515)92$%.1$Q%4B<-"G1Y<&5D968 M455%4EE(04Y$3$52($9!4B`J4%%515)92$%.1$Q%4CL-"B` ("` ("` ("` M24Y214<N2" Y,BD .B!%<G)O<CH )STG+"`G.R< ;W( )RPG(&5X<&5C=&5D M("` ("` ("` ("` ("` 7 T*8SI<9&U<8FEN7"XN7&EN8VQU9&5<=VEN,S)< M5TE.4D5'+D H.34I(#H 17)R;W(Z("<[)R!E>'!E8W1E9"!F;VQL;W=I;F< M9&5C;&%R871I;VX ;V8 <W1R=6-T(&UE;6)E< T*("` (%!1545264A!3D1, M15( <&E?4C!?86QL=F%L<SL-"B` ("` ("` ("` ("` ("` ("` ("` ("` M("` (%X-"F,Z7&1M7&)I;EPN+EQI;F-L=61E7'=I;C,R7%=)3E)%1RY(*#DV M*2`Z($5R<F]R.B`G4%%515)92$%.1$Q%4B< :7, 86QR96%D>2!D969I;F5D M("` ("` ("` ("` ("` 7 T*8SI<9&U<8FEN7"XN7&EN8VQU9&5<=VEN,S)< M5TE.4D5'+D H.3<I(#H 17)R;W(Z("=0455%4EE(04Y$3$52)R!I<R!A;')E M861Y(&1E9FEN960-"D9A=&%L(&5R<F]R.B!T;V\ ;6%N>2!E<G)O<G,-"BTM ` end
May 11 2007
Paul M. skrev:I've tried all day and I can't get the WINSOCK2.H file to even be acceptable. Do I need special switches or other header files? I've tried all kinds of combinations. I've done this stuff under UNIX and with a library for the TI DSP's. They were easy. Any help greatly appreciated. Feel free to point me to some example pages or such.Try: #include <stdio.h> #include <windows.h> void socket_scs(void) { SOCKET sockfd; if ( (sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { printf("socket error\n"); } /* etc... */ } And compile without -A: dmc -c -r -i. -DWIN32 -D_inline=inline socket_scs.c -A (for ANSI C) and windows headers don't mix well. Rember to call WSAStartup once before trying to open your socket. -- Just another homepage: http://damb.dk But it's mine - Bertel
May 11 2007