Thread View: borland.public.cppbuilder.internet.socket
3 messages
3 total messages
Started by Daniel Stevenson
Mon, 21 Nov 2005 22:34
Indy 9: winsock2.h and winsock.h conflict resolution
Author: Daniel Stevenson
Date: Mon, 21 Nov 2005 22:34
Date: Mon, 21 Nov 2005 22:34
25 lines
2053 bytes
2053 bytes
after successfully installing Indy9.0.17, I had to add a conditional _WINSOCKAPI_ which stopped my initial "multiple definitions of ..." conflicts between winsock.h and winsock2.h This then created a lot of other errors "[C++ error] Winsock.hpp(21), E2257 ' expected" on MOST of my existing forms. I therefore had to include "#include <winsock2.h>" before my "#include <vcl.h>" which now leaves me with quite a number of warnings about "[C++ warning] _prolog.h(41): W8059 Structure packaging size has changed size" What has confused me the most is that not all my forms require the "#include <winsock2.h>" before the "#include <vcl.h>" line and still compiled without any errors. According to my research, the windows.h calls upon windows.h which in turn calls upon winsock.h and therefore the only way to stop the errors that are generated is by including winsock2.h prior to vcl.h. But if I can compile a form that is directly using the indy components without first including winsock2.h, how does this not cause a problem with winsock.h? Can someone explain why the include winsock2.h is required in some situations and not in others? Thanks
Re: Indy 9: winsock2.h and winsock.h conflict resolution
Author: noel
Date: Mon, 21 Nov 2005 23:00
Date: Mon, 21 Nov 2005 23:00
39 lines
2813 bytes
2813 bytes
Hello Daniel ! I remember to have had all these symtoms when trying to use some component that uses winsock.h with Indy which uses winsock2.h ... I think the only way to fix this is to make sure you are not using other components that use winsock.h ... This include many of the component in the "Internet" object tab ... and of course make sure you do not include winsock.h in your code ... No�l Daniel Stevenson wrote: > after successfully installing Indy9.0.17, I had to add a conditional > _WINSOCKAPI_ which stopped my initial "multiple definitions of ..." > conflicts between winsock.h and winsock2.h > > This then created a lot of other errors "[C++ error] Winsock.hpp(21), E2257 > ' expected" on MOST of my existing forms. > > I therefore had to include "#include <winsock2.h>" before my "#include > <vcl.h>" which now leaves me with quite a number of warnings about "[C++ > warning] _prolog.h(41): W8059 Structure packaging size has changed size" > > What has confused me the most is that not all my forms require the "#include > <winsock2.h>" before the "#include <vcl.h>" line and still compiled without > any errors. > > According to my research, the windows.h calls upon windows.h which in turn > calls upon winsock.h and therefore the only way to stop the errors that are > generated is by including winsock2.h prior to vcl.h. But if I can compile a > form that is directly using the indy components without first including > winsock2.h, how does this not cause a problem with winsock.h? > > Can someone explain why the include winsock2.h is required in some > situations and not in others? > > Thanks > >
Re: Indy 9: winsock2.h and winsock.h conflict resolution
Author: Remy Lebeau (TeamB)
Date: Mon, 21 Nov 2005 23:45
Date: Mon, 21 Nov 2005 23:45
25 lines
1985 bytes
1985 bytes
"Daniel Stevenson" <daniel@ocreage.com.au> wrote in message news:43824b20$1@newsgroups.borland.com... > I therefore had to include "#include <winsock2.h>" before my > "#include <vcl.h>" which now leaves me with quite a number of > warnings about "[C++ warning] _prolog.h(41): W8059 Structure > packaging size has changed size" That has nothing to do with winsock.h or winsock2.h. That warning is a side effect of Borland changing to a different STL library in BCB 6. The warning is safe to ignore. > According to my research, the windows.h calls upon windows.h > which in turn calls upon winsock.h and therefore the only way to > stop the errors that are generated is by including winsock2.h prior > to vcl.h. But if I can compile a form that is directly using the indy > components without first including winsock2.h, how does this not > cause a problem with winsock.h? If winsock2.h gets included into the precompiler before winsock.h, then winsock2.h disables winsock.h automatically. 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