Thread View: borland.public.cppbuilder.internet.socket
2 messages
2 total messages
Started by SVC
Thu, 02 Mar 2006 21:28
#include <winsock2.h> and compiler error
Author: SVC
Date: Thu, 02 Mar 2006 21:28
Date: Thu, 02 Mar 2006 21:28
17 lines
1317 bytes
1317 bytes
Hi,
I have a project in which, in one header file, I have:
#include <winsock2.h>
I cannot compiler the project since I am getting the error:
[C++ Error] winsock2.h(109): E2238 Multiple declaration for 'fd_set'
[C++ Error] winsock.h(54): E2344 Earlier declaration of 'fd_set'
[C++ Error] winsock2.h(112): E2146 Need an identifier to declare
[C++ Error] winsock2.h(153): E2238 Multiple declaration for 'timeval'
What am I doing wrong?
Thanks,
S.
Re: #include <winsock2.h> and compiler error
Author: Remy Lebeau (TeamB)
Date: Thu, 02 Mar 2006 21:38
Date: Thu, 02 Mar 2006 21:38
17 lines
1461 bytes
1461 bytes
"SVC" <svchamlian@hotmail.com> wrote in message news:44076329$1@newsgroups.borland.com... > I have a project in which, in one header file, I have: > #include <winsock2.h> > > I cannot compiler the project since I am getting the error: Your code is including winsock.h earlier in the compiling. If winsock2.h is included before winsock.h then winsock.h is automatically disabled. But if winsock.h is included before winsock2.h, then you get the errors because winsock2.h is badly designed, and redeclares most things that winsock.h has already declared. Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads