Article View: borland.public.cppbuilder.internet.socket
Article #3119Re: Indy 9: winsock2.h and winsock.h conflict resolution
From: 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 > >
Technical Details
Message-ID:
<43825125$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43824b20$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6c4df013894db185 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII Date: Mon, 21 Nov 2005 18:00:15 -0500 From: noel <noel@teledata.qc.ca> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: Indy 9: winsock2.h and winsock.h conflict resolution References: <43824b20$1@newsgroups.borland.com> In-Reply-To: <43824b20$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 207.96.139.132 Message-ID: <43825125$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1132613925 207.96.139.132 (21 Nov 2005 14:58:45 -0700) Lines: 39 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail