Re: Building under Visual Studio 2008 - pqcomm.c compile error - Mailing list pgsql-hackers

From Dave Huber
Subject Re: Building under Visual Studio 2008 - pqcomm.c compile error
Date
Msg-id 7CDADB576E07AC4FA71E1B12566C9126540E0A0C23@lti-mb-1.LTI.com
Whole thread Raw
In response to Building under Visual Studio 2008 - pqcomm.c compile error  ("Knight, Doug" <dknight@wsi.com>)
Responses Re: Building under Visual Studio 2008 - pqcomm.c compile error
List pgsql-hackers
<div class="Section1"><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">I’m getting this same error and wonder if Tom’s fix is
sufficient.</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">IPPROTO_IPV6
isdefined in wd2def.h IF _WIN32_WINNT >= 0x0501, but in</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">pg_config_os.h_WIN32_WINNT is DEFINED as 0x0500 so IPPROTO_IPV6 is left</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">undefined.</span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black"> </span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">Regards,</span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">Dave</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">-----------------------</span></font><pclass="MsoNormal"><font color="black" face="Courier New"
size="2"><spanlang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">Unfortunately I had to uninstall
VS2005to install VS2008 due to limited</span></font><p class="MsoNormal"><font color="black" face="Courier New"
size="2"><spanlang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">space, or I'd search the old
librariesto see where the symbol used to</span></font><p class="MsoNormal"><font color="black" face="Courier New"
size="2"><spanlang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">be. Anyone care to search their
VS2005includes for IPPROTO_IPV6 so I</span></font><p class="MsoNormal"><font color="black" face="Courier New"
size="2"><spanlang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">can compare to the VS2008?
</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">Also,
followingthe usual build procedure (using build.bat/build.pl), I</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">encountered
errorssaying I needed to do "vcbuild /upgrade" on</span></font><p class="MsoNormal"><font color="black" face="Courier
New"size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">postgres.vcproj,
libpgport.vcproj,and pgevent.vcproj. After consulting</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">with one of
ourQA people who builds stuff in Windows all the time, I</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">came up with
thefollowing procedure to build postgres under VS2008</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">(This
includeschanging pqcomm.c per Tom's comment below):</span></font><p class="MsoNormal"><font color="black" face="Courier
New"size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">(in msvc)</span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">mkvcbuild.pl</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span
lang="EN"style="font-size:10.0pt;font-family:"Courier New";color:black">cd ..\..\..</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">vcbuild /upgrade postgres.vcproj</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">vcbuild /upgrade libpgport.vcproj</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">vcbuild /upgrade pgevent.vcproj</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">(actually, I wound up creating a script that did vcbuild
/upgradeto ALL</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">of the vcproj files here)</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">msbuild pgsql.sln</span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black"> </span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">Note that after doing all the vcbuild /upgrade commands,
Iused msbuild</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">referencing the pgsql.sln file instead of vcbuild to do
theactual</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">build. So, aside from the issue of the missing
IPPROTO_IPV6symbol, its</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
lang="EN"style="font-size:10.0pt;font-family:"Courier New";color:black">built under VS2008. It will probably be some
timebefore I can try</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">running postgres built this way, as we're under the gun
toget a release</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">out this week. </span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black"> </span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">I'm not an MS developer by any means, so if someone has a
betterway to</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">do this feel free to say so. This is what worked for
me.</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">Doug</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">-----Original
Message-----</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">From: Tom Lane [<a
href="mailto:tgl">mailto:tgl</a>(at)sss(dot)pgh(dot)pa(dot)us]</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">Sent: Monday,
July14, 2008 12:05 PM</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">To: Knight, Doug</span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">Subject:Re: [HACKERS] Building under Visual Studio 2008 - pqcomm.c</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">compile error </span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black"> </span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">"Knight, Doug" <dknight(at)wsi(dot)com>
writes:</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">> Since I am primarily a Linux-based coder, do you
knowwhere I would</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">find</span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">>the header files under VS2005 or 2008?</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black"> </span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">No idea, I don't use MSVC.</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">> Also, it
lookslike the</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">> IPPOROTO_IPV6 is only used within a ifdef check for
IPV6_ONLY.Is</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">there</span></font><p class="MsoNormal"><font
color="black"face="Courier New" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">>some way I could "undefined" it to prevent this part of the code from</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">> being compiled?</span></font><p
class="MsoNormal"><fontcolor="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">Well, you
couldjust change</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">#ifdef
IPV6_V6ONLY</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">to
</span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";color:black">#if
defined(IPPROTO_IPV6)&& defined(IPV6_V6ONLY)</span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black"> </span></font><pclass="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">and then it would compile --- but whether it would work
rightis less</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">clear, unless your machine doesn't do IPV6 anyway.  Since
weknow this</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">code compiles under VS2005, I'm inclined to recommend
thatyou look</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black">for the real solution, which is to find out where that
symbolwent...</span></font><p class="MsoNormal"><font color="black" face="Courier New" size="2"><span lang="EN"
style="font-size:10.0pt;font-family:"CourierNew";color:black"> </span></font><p class="MsoNormal"><font color="black"
face="CourierNew" size="2"><span lang="EN" style="font-size:10.0pt;font-family:"Courier
New";color:black">                      regards, tom lane</span></font><p class="MsoNormal"><font face="Courier New"
size="2"><spanstyle="font-size:10.0pt; 
font-family:"Courier New""> </span></font></div><br /><hr /><font color="Blue" face="Arial" size="1">This electronic
mailmessage is intended exclusively for the individual(s) or entity to which it is addressed. This message, together
withany attachment, is confidential and may contain privileged information. Any unauthorized review, use, printing,
retaining,copying, disclosure or distribution is strictly prohibited. If you have received this message in error,
pleaseimmediately advise the sender by reply email message to the sender and delete all copies of this message.<br />
THISE-MAIL IS NOT AN OFFER OR ACCEPTANCE: Notwithstanding the Uniform Electronic Transactions Act or any other law of
similarimport, absent an express statement to the contrary contained in this e-mail, neither this e-mail nor any
attachmentsare an offer or acceptance to enter into a contract, and are not intended to bind the sender, LeTourneau
Technologies,Inc., or any of its subsidiaries, affiliates, or any other person or entity.<br /> WARNING: Although the
companyhas taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept
responsibilityfor any loss or damage arising from the use of this email or attachments.<br /><br /></font> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: \d+ for long view definitions?
Next
From: "Kevin Grittner"
Date:
Subject: Re: \d+ for long view definitions?