Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4A2E6B5DBD8 for ; Wed, 14 Sep 2011 12:04:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 84159-05 for ; Wed, 14 Sep 2011 15:04:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from exprod7og126.obsmtp.com (exprod7og126.obsmtp.com [64.18.2.206]) by mail.postgresql.org (Postfix) with ESMTP id 95582B5DBCB for ; Wed, 14 Sep 2011 12:04:13 -0300 (ADT) Received: from mail-fx0-f50.google.com ([209.85.161.50]) (using TLSv1) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP ID DSNKTnDCbIUA5NR0Ys1pzH1c1lGzUP6BRBsY@postini.com; Wed, 14 Sep 2011 08:04:13 PDT Received: by fxh10 with SMTP id 10so2042584fxh.23 for ; Wed, 14 Sep 2011 08:04:11 -0700 (PDT) Received: by 10.223.91.147 with SMTP id n19mr294268fam.53.1316012650908; Wed, 14 Sep 2011 08:04:10 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi. [88.195.122.240]) by mx.google.com with ESMTPS id l20sm3625657fad.12.2011.09.14.08.04.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Sep 2011 08:04:09 -0700 (PDT) Message-ID: <4E70C265.2000209@enterprisedb.com> Date: Wed, 14 Sep 2011 18:04:05 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 MIME-Version: 1.0 To: Steve CC: pgsql-bugs@postgresql.org Subject: Re: BUG #6203: Building libpq with Visual Studio 9.0 error References: <201109140523.p8E5N9fJ050888@wwwmaster.postgresql.org> In-Reply-To: <201109140523.p8E5N9fJ050888@wwwmaster.postgresql.org> Content-Type: multipart/mixed; boundary="------------020107030502020200000807" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/76 X-Sequence-Number: 31093 This is a multi-part message in MIME format. --------------020107030502020200000807 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 14.09.2011 08:23, Steve wrote: > > The following bug has been logged online: > > Bug reference: 6203 > Logged by: Steve > Email address: argonaut@yandex.ru > PostgreSQL version: 9.1.0 > Operating system: Windows XP SP3 x32 > Description: Building libpq with Visual Studio 9.0 error > Details: > > When I'm trying to build libpq client library > with Visual Studio 9.0 (as described in documentation > section 16.2, I mean executing "nmake /f win32.mak" in > command string), linking step gives me this error: > > "link.exe @C:\DOCUME~1\Admin\LOCALS~1\Temp\nm36.tmp > Creating library .\Release\libpqdll.lib and object > .\Release\libpqdll.exp > libpq.lib(chklocale.obj) : error LNK2019: unresolved > external symbol _pgwin32_setlocale referenced in > function _pg_get_encoding_from_locale > .\Release\libpq.dll : fatal error LNK1120: 1 unresolved > externals" libpq needs to link in win32setlocale.c, but that was neglected in that makefile used for stand-alone libpq builds. To be honest, I didn't even know you can build libpq that way until now. I just committed a fix for that, you can pull the latest sources from the git repository. The patch I committed is also attached, if you want to just apply it to your current 9.1.0 sources. Thanks for the report! -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com --------------020107030502020200000807 Content-Type: text/x-diff; name="fix-libpq-win-build.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-libpq-win-build.patch" commit 09e98a3e170ecdeb25a0e1afe81bdbeeeaf21f48 Author: Heikki Linnakangas Date: Wed Sep 14 17:57:32 2011 +0300 Teach the makefile used to build stand-alone libpq on Windows that libpq needs win32setlocale.c now. The cygwin and MSVC build scripts were changed earlier, but this was neglected. This should fix bug report #6203 by Steve. diff --git a/src/interfaces/libpq/win32.mak b/src/interfaces/libpq/win32.mak index fd778d0..70a741a 100644 --- a/src/interfaces/libpq/win32.mak +++ b/src/interfaces/libpq/win32.mak @@ -87,8 +87,8 @@ CLEAN : -@erase "$(INTDIR)\inet_aton.obj" -@erase "$(INTDIR)\crypt.obj" -@erase "$(INTDIR)\noblock.obj" - -@erase "$(INTDIR)\chklocale.obj" - -@erase "$(INTDIR)\inet_net_ntop.obj" + -@erase "$(INTDIR)\chklocale.obj" + -@erase "$(INTDIR)\inet_net_ntop.obj" -@erase "$(INTDIR)\md5.obj" -@erase "$(INTDIR)\ip.obj" -@erase "$(INTDIR)\fe-auth.obj" @@ -114,6 +114,7 @@ CLEAN : -@erase "$(INTDIR)\pgsleep.obj" -@erase "$(INTDIR)\open.obj" -@erase "$(INTDIR)\win32error.obj" + -@erase "$(INTDIR)\win32setlocale.obj" -@erase "$(OUTDIR)\$(OUTFILENAME).lib" -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib" -@erase "$(OUTDIR)\libpq.res" @@ -159,6 +160,7 @@ LIB32_OBJS= \ "$(INTDIR)\pgsleep.obj" \ "$(INTDIR)\open.obj" \ "$(INTDIR)\win32error.obj" \ + "$(INTDIR)\win32setlocale.obj" \ "$(INTDIR)\pthread-win32.obj" @@ -330,6 +332,11 @@ LINK32_OBJS= \ $(CPP_PROJ) /I"." ..\..\port\win32error.c << +"$(INTDIR)\win32setlocale.obj" : ..\..\port\win32setlocale.c + $(CPP) @<< + $(CPP_PROJ) /I"." ..\..\port\win32setlocale.c +<< + .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< --------------020107030502020200000807--