Board index » cppbuilder » TIdHTTP client in an NT Service

TIdHTTP client in an NT Service


2005-04-22 05:07:01 AM
cppbuilder79
I've update to indy 9.14, when adding a IdHTTP Client to the service, the
compiler reports Multiple declaration errors.
[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'
[C++ Error] winsock.h(97): E2344 Earlier declaration of 'timeval'
[C++ Error] winsock2.h(209): E2238 Multiple declaration for 'hostent'
[C++ Error] winsock.h(153): E2344 Earlier declaration of 'hostent'
[C++ Error] winsock2.h(222): E2238 Multiple declaration for 'netent'
[C++ Error] winsock.h(166): E2344 Earlier declaration of 'netent'
Is this a bad build? I read about the 9.18 being incomplete. I can not find
any later releases.
Thanks for the help
 
 

Re:TIdHTTP client in an NT Service

"No-Spam" < XXXX@XXXXX.COM >wrote in message
Quote
I've update to indy 9.14, when adding a IdHTTP Client to
the service, the compiler reports Multiple declaration errors.
Indy uses WinSock v2.0. Most VCL socket components, including the ones that
ship with BCB, still use WinSock v1.x instead. The headers for the two are
not compatible with each other. winsock2.h disabled winsock.h if winsock2.h
gets included by the preprocessor first, but if winsock.h is included first
then all hell breaks loos. Don't mix other socket components with Indy. If
you do a search in the newsgroup archives at www.deja.com , you will
see this issue discussed many times before.
Gambit
 

Re:TIdHTTP client in an NT Service

Thanks ... i am not mixing any other components, just as a test i created a
New Service application and just placed the IdHTTP Client component on there
... the errors were as noted.
I did search deja.com and found a suggestion to use the define statement:-
#ifndef _WINSOCKAPI_ // magic incantation to avoid windows calling in
winsock.h
#define _WINSOCKAPI_
#endif
that seemed to work.
Thanks again
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"No-Spam" < XXXX@XXXXX.COM >wrote in message
news:426815f6$ XXXX@XXXXX.COM ...

>I've update to indy 9.14, when adding a IdHTTP Client to
>the service, the compiler reports Multiple declaration errors.

Indy uses WinSock v2.0. Most VCL socket components, including the ones
that
ship with BCB, still use WinSock v1.x instead. The headers for the two
are
not compatible with each other. winsock2.h disabled winsock.h if
winsock2.h
gets included by the preprocessor first, but if winsock.h is included
first
then all hell breaks loos. Don't mix other socket components with Indy.
If
you do a search in the newsgroup archives at www.deja.com , you
will
see this issue discussed many times before.


Gambit


 

{smallsort}